【发布时间】:2023-03-22 14:13:01
【问题描述】:
我有一个应用程序需要 不同的过滤器,这些过滤器是通过单击 按钮 实现的,现在我的屏幕空间不足,因为我还有 @987654322 @实现,应用的布局如下图所示:
正如所见,没有足够的空间来显示 15 个按钮,并不是说一起显示 15 个按钮看起来很奇怪,所以我怎样才能以用户友好的方式在屏幕上显示 15 个按钮(例如,ScrollDown for更多按钮),如果有人有一些示例代码,我将不胜感激。
对于想要查看布局的.xml 文件的人,这里是下面的代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/black"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/filter_linear_layout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/filter1_button"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@drawable/button_white_red_transluscent"
android:text="@string/filter1_text"
android:textColor="@android:color/white" />
<Button
android:id="@+id/filter2_button"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@drawable/button_white_red_transluscent"
android:text="@string/filter2_text"
android:textColor="@android:color/white" />
....and so on for the rest of the buttons
</LinearLayout>
<ImageView
android:id="@+id/filter_image_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@id/filter_linear_layout" />
【问题讨论】:
标签: java android xml button layout