Android 在屏幕右侧的按钮中添加按钮
我有下面的android布局,在屏幕上显示脚趾列表视图,一个在左侧,另一个在右侧Android 在屏幕右侧的按钮中添加按钮,android,android-layout,Android,Android Layout,我有下面的android布局,在屏幕上显示脚趾列表视图,一个在左侧,另一个在右侧 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_paren
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/ListView01"/>
<ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="3" android:id="@+id/ListView02"/>
现在我想添加一个显示在屏幕右下方的按钮。
有人能帮我解决这个问题吗?一个可能的解决方案应该是:添加一个RelativeLayout作为根布局,并将按钮放在LinearLayout之后,属性layout在下方,布局在右侧(LinearLayout作为参考)。
首先删除线性布局,使用relative layout。对于按钮,请使用以下命令
android:layout\u alignParentBottom=“true”和android:layout\u alignParentRight=“true”尝试使用以下代码
<?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:orientation="horizontal"
android:background="#ffffff"
>
<Button
android:id="@+id/click"
android:layout_width="100dip"
android:layout_height="60dip"
android:text="Click"
android:layout_alignParentRight="true"
/>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ListView02"
android:background="#00ff00"
android:layout_toLeftOf="@+id/click"
/>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ListView01"
android:background="#000000"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/ListView02"
/>
</RelativeLayout>
谢谢
Deepak你是说在列表的右下角还是就在右侧?是的,这是错的,我是说屏幕的右下角实际上我希望我的按钮从listaview2向下