<?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">
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/testbutton"
android:text="@string/hello" android:layout_alignParentBottom="true" />
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/list"
android:layout_alignParentTop="true" android:layout_above="@id/testbutton" />
</RelativeLayout>android:layout_above="@id/testbutton" 让ListView 在 Button之上
XML布局解析
本文解析了一个使用XML定义的Android布局文件,包含一个RelativeLayout作为根布局,内部有两个子元素:ListView和Button。ListView占据大部分空间,而Button位于底部。
468

被折叠的 条评论
为什么被折叠?



