I want to fix FAB at the bottom of the window. Ie, that one half was in the window, and the other on the blackout. Now the window layout looks like this

 <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="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="center" android:weightSum="100" android:id="@+id/alert_root" android:layout_marginBottom="10dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp"> <widget.CircleImageView android:layout_height="match_parent" android:layout_width="wrap_content" android:id="@+id/alert_photo" android:src="@drawable/image_1" android:background="@drawable/circle" android:layout_weight="75" android:layout_marginLeft="10dp"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginLeft="10dp" android:gravity="right|center_vertical" android:layout_weight="25" android:layout_marginRight="10dp"> <android.support.design.widget.TextInputLayout android:id="@+id/alert_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColorHint="#000000"> <android.support.v7.widget.AppCompatEditText android:id="@+id/input_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Имя" android:textColor="#000000"/> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:id="@+id/alert_family" android:layout_width="match_parent" android:textColorHint="#000000" android:layout_marginTop="7dp" android:layout_height="wrap_content"> <android.support.design.widget.TextInputEditText android:id="@+id/input_family" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Фамилия" android:textColor="#000000"/> </android.support.design.widget.TextInputLayout> </LinearLayout> </LinearLayout> <android.support.design.widget.TextInputLayout android:id="@+id/alert_verbose" android:layout_width="match_parent" android:textColorHint="#000000" android:layout_marginTop="7dp" android:layout_height="wrap_content" android:layout_margin="10dp"> <android.support.design.widget.TextInputEditText android:id="@+id/input_verbose" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Описание" android:textColor="#000000"/> </android.support.design.widget.TextInputLayout> </LinearLayout> <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/done" app:backgroundTint="#F28A14" app:layout_anchor="@id/alert_root" android:src="@drawable/fab_add" app:layout_anchorGravity="top|end"/> </android.support.design.widget.CoordinatorLayout> 

Screenshot:

enter image description here

It seems to use the anchor correctly. But something is wrong ...

  • Why do you use CoordinatorLayout, you do not seem to have dynamic widgets (some kind of retractable parts). I don’t think that the button can be moved out of the bounds of the root container (the dialog box frame) - pavlofff
  • I use anchor . It works with the CoordinatorLayout . Can. Saw the window in which the FAB also jutted out half. - Flippy
  • one
    Use negative margins or make markup so that FAB gets out of the dialogue by adding dialogue and FAB to another container - YuriySPb
  • Thank you, but changed my mind. - Flippy
  • I will wait while there will be more normal tutorial. This anchor is not yet thought out - Flippy

0