我设法让按钮一直可见,这很难看。
根据新材料设计,我们应该使用 RecyclerView 而不是 ListView,所以我想知道如何让按钮仅在用户滚动到列表末尾时出现,但始终不可见。
此外,由于一些未解决的问题 72217,回收站视图无法在工作室中呈现。所以我看不到元素按钮和回收站视图如何相互对齐
主活动.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include android:id="@+id/app_bar" layout="@layout/toolbar"/>
<ImageButton
android:id="@+id/button_previous"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:minHeight="25dp"
android:minWidth="70dp"
android:src="@android:drawable/ic_media_previous"/>
<ImageButton
android:id="@+id/button_next"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:minHeight="25dp"
android:minWidth="70dp"
android:src="@android:drawable/ic_media_next"/>
<view
android:id="@+id/recycler_view"
android:layout_below="@id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="android.support.v7.widget.RecyclerView"/>
第二个问题:我只能看到一个 FORWARD 按钮,而不是 2 个按钮,即使我在上面的代码中声明了这两个按钮并为两个向前向后按钮都使用了属性alignParentright = true 和 alignParentLeft=true 。