1

Ich versuche, Elevation Schatten auf Header in einer erweiterbaren ListView zu zeigen. Seine Arbeiten an Marshmallow (Galaxy 7) und auf Lollipop (Galaxy 4s) funktioniert nicht. Wie kann es sein? hier ist mein Code:Warum Höhenarbeit auf Marshmallow und auf Lollipop tut es nicht

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 

Antwort

0

Nicht genügend Informationen über Variablen und dass der Code tut.

Stellen Sie sicher, dass

if (bottom >= mFloatingGroupView.getMeasuredHeight())

wahr ist, wenn auf Galaxie s4 runing.

+0

Sure ist wahr. Ich debugge es. – Anna

+0

Der Schatten funktioniert nur auf Marshmallow-Geräten – Anna

+0

Sie haben nicht angegeben, was UI_Helper tut. –