来自android BottomSheetDialog的getContentView()

时间:2017-06-05 07:21:57

标签: android bottom-sheet

有没有办法从android ContentView获取BottomSheetDialog?在PopupWindow中,我可以通过PopupWindow方法获取popupWindow.getContentView()的观看次数。但是,我找不到任何从ConentView获取BottomSheetDialog的方法。

1 个答案:

答案 0 :(得分:2)

请试试这个:

        if (JSON.parse(localStorage.getItem('currentClass')) == "active")
        {
            jQuery('#supporttbl').addClass('active')
            $('.sub-menu').css({ "display": "block" });
        }

        $("#supporttbl").click(function () { 
            var currentClass;
            if ($(this).attr('class')== "active") { 

                currentClass = $(this).attr('class');

                localStorage.setItem('currentClass', JSON.stringify(currentClass));
                console.log(JSON.parse(localStorage.getItem('currentClass')));

                jQuery('#supporttbl').addClass('active')
                $('.sub-menu').css({ "display": "block" });

            } else {

                currentClass = "Null"; 

                localStorage.setItem('currentClass', JSON.stringify(currentClass));
                console.log(JSON.parse(localStorage.getItem('currentClass')));

                jQuery('#supporttbl').removeClass('active')
                $('.sub-menu').css({ "display": "none" });

            }  
        });