【发布时间】:2021-07-02 09:25:18
【问题描述】:
我的浮动操作按钮看起来像this.
它应该显示一个加号图标。
我的代码:
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.tasks.TasksFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_tasks"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_add_task"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
【问题讨论】:
标签: android xml floating-action-button