【发布时间】:2011-12-06 20:37:57
【问题描述】:
我有这个RelativeLayout 我正在使用:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:id="@+id/screen_team_enableproximity"
android:text="Enable proximity"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/screen_team_checkboxproximity"
android:layout_alignBottom="@+id/screen_team_checkboxproximity"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/screen_team_checkboxproximity"></Button>
<CheckBox
android:layout_width="wrap_content"
android:id="@+id/screen_team_checkboxproximity"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:clickable="false"></CheckBox>
<ExpandableListView
android:layout_width="match_parent"
android:id="@+id/screen_team_teamslist"
android:layout_height="match_parent"
android:layout_below="@+id/screen_team_availableteams"
android:layout_centerHorizontal="true"></ExpandableListView>
<TextView
android:layout_width="wrap_content"
android:id="@+id/screen_team_availableteams"
android:text="Available Teams"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="@+id/screen_team_getallteams"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"></TextView>
<Button
android:text="Create Team"
android:id="@+id/screen_team_createteam"
android:layout_height="wrap_content"
android:layout_below="@+id/screen_team_enableproximity"
android:layout_width="match_parent"
android:layout_marginTop="65dip"></Button>
<Button
android:text="Delete Team"
android:id="@+id/screen_team_deleteteam"
android:layout_height="wrap_content"
android:layout_below="@+id/screen_team_createteam"
android:layout_centerHorizontal="true"
android:layout_width="match_parent"></Button>
<Button
android:layout_width="match_parent"
android:text="Get available teams"
android:id="@+id/screen_team_getallteams"
android:layout_height="wrap_content"
android:layout_below="@+id/screen_team_deleteteam"
android:layout_alignParentLeft="true"></Button>
</RelativeLayout>
问题是我希望它在 ScrollView 或类似的内部使用 - 整个布局不适合屏幕,尤其是当您向 ExpandableListView 添加多个组时。
我尝试将RelativeLayout 放入ScrollView,但它根本不起作用。
如何设置包含RelativeLayout 的滚动屏幕?
【问题讨论】:
标签: android scrollview android-relativelayout expandablelistview