Android 添加按钮-如何添加?
Android 添加按钮-如何添加?,android,Android,如何在可滚动列表视图上添加查看和排序按钮如果您想根据图片在版面中添加两个按钮,您已经上传到问题中,那么您可以使用相对版面作为XML的主版面 然后进入相对布局,使用仅包含顶部文件管理器、顶部两个按钮和列表视图的线性布局 然后将第二个线性布局添加到第一个线性布局下方的主相对布局中。第二个线性布局包含两个按钮“视图”和“过滤器” 它将如下所示: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="
如何在可滚动列表视图上添加查看和排序按钮如果您想根据图片在版面中添加两个按钮,您已经上传到问题中,那么您可以使用相对版面作为XML的主版面 然后进入相对布局,使用仅包含顶部文件管理器、顶部两个按钮和列表视图的线性布局 然后将第二个线性布局添加到第一个线性布局下方的主相对布局中。第二个线性布局包含两个按钮“视图”和“过滤器” 它将如下所示:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- here your top search bar comes -->
<!-- here your horizontal layout with two buttons Rent and Buy are comes.-->
<!-- here your list or recycler view comes-->
</LinearLayout>
<!-- This below layout contains the two button which you want to add as per your question. -->
<!-- You can add the background or style to layout and buttons as your wish. -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="20dp"
android:gravity="center"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="View" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sort" />
</LinearLayout>
</RelativeLayout>
请向我们展示您迄今为止的尝试。这不是一个编码服务,所以我们不会为您编写完整的解决方案。谢谢您的理解。谢谢您的回复,先生。我已经创建了如图所示的整个UI,我只想在listview上添加两个按钮,我只需要一个提示,即按钮类型或只是一个小说明,我应该尝试什么。您明白了吗@穆罕默德·纳瓦迪这很好,谢谢。。