ScrollView充满屏幕

来源:互联网 发布:管家婆导入数据 编辑:程序博客网 时间:2024/05/21 09:08
<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="@android:color/holo_green_light" >    <LinearLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:background="@android:color/holo_orange_light"        android:orientation="vertical" >        <TextView            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:text="@string/app_name" />    </LinearLayout></ScrollView>

如上代码,LinearLayout明明设置了match_parent,但却无法充满屏幕

这时需要设置ScrollView的属性:android:fillViewport="true"

0 0
原创粉丝点击