When clicking on the FoatingActionButton (FAB) , the SnackBar should trigger. Here is the markup when everything worked smoothly:

 <?xml version="1.0" encoding="utf-8"?> 

 <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <RelativeLayout android:id="@+id/viewA" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.6" android:background="#424242" android:orientation="horizontal"/> <LinearLayout android:id="@+id/viewB" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.4" android:background="#DD6E19" android:orientation="horizontal"/> </LinearLayout> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" android:clickable="true" app:backgroundTint="#ffffff" android:src="@drawable/ic_launcher" app:layout_anchor="@id/viewA" app:layout_anchorGravity="bottom|right|end"/> </android.support.design.widget.CoordinatorLayout> 

But if in RelativeLayout (with id=viewA ) in background instead of color #424242 put the @drawable/header link on the picture, then when I click on FAB the click animation itself and the SnackBar -a animation SnackBar .

What's wrong?

  • one
    The picture is heavy. Try to reduce it - YuriySPb
  • what is this drawable - @drawable/header ? - Vladyslav Matviienko
  • Already all) It was a 2-megabyte picture of the hd in the style of material design)) - Flippy

0