Android 为什么提升在棉花糖和棒棒糖上不起作用';T

Android 为什么提升在棉花糖和棒棒糖上不起作用';T,android,android-5.0-lollipop,android-6.0-marshmallow,elevation,Android,Android 5.0 Lollipop,Android 6.0 Marshmallow,Elevation,我试图在expandableListView中显示标题上的高程阴影。 它在棉花糖(galaxy 7)和棒棒糖(galaxy 4s)上的作用不起作用。 怎么可能? 这是我的密码: ViewGroup divider = (ViewGroup) ((ViewGroup) mFloatingGroupView).getChildAt(1); ViewGroup container = (ViewGroup) ((ViewGroup) mFloatingGroupView).getChildAt(0)

我试图在expandableListView中显示标题上的高程阴影。 它在棉花糖(galaxy 7)和棒棒糖(galaxy 4s)上的作用不起作用。 怎么可能? 这是我的密码:

ViewGroup divider = (ViewGroup) ((ViewGroup) mFloatingGroupView).getChildAt(1);
 ViewGroup container = (ViewGroup) ((ViewGroup) mFloatingGroupView).getChildAt(0);
        //LOLLIPOP++
                //Effect with elevation
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    if (bottom >= mFloatingGroupView.getMeasuredHeight()) {
                            if (container instanceof LinearLayout) {
                                container.setBackgroundColor(UI_Helper.getColorFromThemeAttr(getContext(), R.attr.bg_color));
                                UI_Helper.setShadow(getContext(), container, 6);
                            }
                        if(divider instanceof LinearLayout){
                            divider.setVisibility(GONE); // set divider gone
                        }
                    }else{
                        if(divider instanceof LinearLayout){
                            divider.setVisibility(VISIBLE); //set divider Visible
                        }
                    }
                }//KITKAT

没有足够的关于变量和代码的信息

确保

if(底部>=mFloatingGroupView.getMeasuredHeight())


在galaxy s4上运行时为真。

没有足够的变量信息,代码也没有

确保

if(底部>=mFloatingGroupView.getMeasuredHeight())


在galaxy s4上运行时为真。

确定为真。我调试它。你没有提供UI\U帮助程序所做的信息。它只是获取颜色并设置为视图的背景。确保为真。我调试了它。你没有提供UI\U助手所做的信息。它只是获取颜色并设置为视图的背景