【发布时间】:2014-03-20 14:44:28
【问题描述】:
我的问题是我无法在列表视图下的布局中显示两个按钮。下面我在相对布局中有一个列表视图。我有第二个相对布局,其中包含 2 个按钮。按钮似乎显示在列表顶部,而我希望它们位于列表下方。
我该怎么做? 我尝试在第二个 RRlayout 中设置“android:layout_below”,将第一个布局作为锚点。
提前致谢。
<?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"
>
<TextView
android:id="@+id/textviewcarername"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/blue_alpha_background"
android:gravity="center"
android:text="Rota "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/carerdetailsfragrellayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textviewcarername"
android:background="@drawable/textviewbg"
android:padding="10dp" >
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:cacheColorHint="#0000"
android:divider="#700000ff"
android:dividerHeight="4px" >
</ListView>
</RelativeLayout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
>
<Button
android:id="@+id/buttonprevious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Previous" />
<Button
android:id="@+id/buttonnext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Next" />
</RelativeLayout>
</RelativeLayout>
【问题讨论】:
标签: android view android-relativelayout