Я использовал код от here. В моем случае это выглядит какПлавающая кнопка действия (FAB) над ListView в фрагменте в xml?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.FragmentList"
android:orientation="vertical"
android:id="@+id/linear">
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView" />
</LinearLayout>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_white_24dp"
android:layout_gravity="bottom|end"
fab:elevation="6dp"
fab:pressedTranslationZ="12dp"
fab:backgroundTint="@color/accent"
app:layout_anchor="@id/listView"/>
</android.support.design.widget.CoordinatorLayout>
Но у меня есть «несколько тегов корневых» в Android Studio. Что я сделал не так? Пожалуйста, помогите мне, я не могу понять ((
поместить все внутри координатора л ayout –
Спасибо! Почему android: layout_gravity = "bottom | end" не работает? FAB находится слева и сверху –