android ScrollView的用法
我想给activity加入滚动条,xml文件格式为
[解决办法]
android:layout_width="match_parent"
android:layout_height="wrap_content"
都改为fill_parent:
fill_parent布局指将视图(在Windows中称为控件)扩展以填充所在容器的全部空间。
wrap_content布局指根据视图内部内容自动扩展以适应其大小。
[解决办法]
ScrollView和ListView不能同时存在,好像在android中有两个可以滚动的控件同时在在或者嵌入存在的时候有LZ所说的问题出现
[解决办法]
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="fill_parent"
android:weightSum="1">
<RelativeLayout android:id="@+id/relativeLayout1"
android:layout_height="match_parent" android:layout_width="match_parent">
<ListView android:id="@id/android:list"
android:drawSelectorOnTop="false" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_above="@+id/buttonstart"/>
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/buttonstart"
android:layout_above="@+id/buttonstop"
android:layout_alignParentLeft="true"></Button>
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/buttonstop"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"></Button>
</RelativeLayout>
</LinearLayout>