【发布时间】:2021-06-15 00:29:15
【问题描述】:
为什么这不起作用? 这是列表视图的问题。 我尝试了很多方法,结果按钮没有显示
<FrameLayout 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=".fragments.notes.NotesFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="@drawable/ic_baseline_add_24" />
</LinearLayout>
</ScrollView>
</FrameLayout>```
【问题讨论】:
-
你试过把你的 FAB 放在 ScrollView 之外吗?
-
当我运行应用程序时按钮仍然不显示
标签: java android listview scrollview android-framelayout