I have a CoordinatroLayout with a FloatingActionButton . Here is my code:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar_layout" android:layout_above="@+id/actionbar"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="120dp" android:minHeight="?android:attr/actionBarSize" android:background="@color/toolbar_color" /> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" > </ScrollView> </LinearLayout> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" app:fabSize="mini" android:src="@mipmap/ic_action_edit" app:layout_anchor="@id/toolbar" app:layout_anchorGravity="bottom|right|end" app:backgroundTint="@color/toolbar_color" /> </android.support.design.widget.CoordinatorLayout>
But it looks different in devices with a lollipop and before Lellipops.
Lollipop:

Pre-Lollipop: 
In fact, I am not adding any fields. But FAB has an advantage in pre-cooled devices.
I also saw this problem in the cheessesquare example. It also shows different fields. What is the problem?
android android-layout floating-action-button android-coordinatorlayout
Misagh emamverdi
source share