ter*_*tor 5 layout android scrollview
我有一个只有ScrollView可见的布局.它有一个相对布局作为它的孩子.此布局具有其他几种布局(主要是文本视图)作为其子项.当文本不够大时,滚动视图不会自动展开以适合整个屏幕.相反,它显示背景显示底部的间隙.我尝试fillViewPort=true在ScrollView上进行设置,但这只是让第一个子布局(RL1)填满了屏幕.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_image">
<ProgressBar android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewPort="true"
android:scrollbars="none">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10px">
<RelativeLayout android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10px">
<!-- This layout is filling the screen if I set fillViewPort="true" -->
<RelativeLayout android:id="@+id/RL1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--TextViews and ImageViews -->
</RelativeLayout>
<RelativeLayout android:id="@+id/RL2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--TextViews and ImageViews -->
</RelativeLayout>
<RelativeLayout android:id="@+id/RL3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<!--TextViews and ImageViews -->
</RelativeLayout>
<RelativeLayout android:id="@+id/RL4"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--TextViews and ImageViews -->
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13316 次 |
| 最近记录: |