Я создаю простое приложение, используя дизайн материалов. Я хочу получить две плавающие кнопки внутри одного макета.
И я хочу, чтобы они двигались вместе, когда отображается закусочная.
Но я не могу сделать это правильно, потому что layout_margin
не работает.
Это скриншоты приложения и разметки. Можете вы помочь мне?
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/addProductsContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/addProductsAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.TabLayout
android:id="@+id/addProductsTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/addProductsViewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/addProductFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:src="@drawable/ic_add_white_36dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/searchFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/addProductFab"
app:layout_anchorGravity="top|right|end"
android:layout_marginBottom="80dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_search_white_36dp" />
</android.support.design.widget.CoordinatorLayout>