我开发了一个Android应用程序,它有ListView。它在模拟器和HTC设备中滚动得很好,但在三星Galaxy S和三星Vibrant手机中滚动不起作用,我得到了这个问题的原因,我的代码在下面..
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="@drawable/x01_background">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/topgroupwarmup"
></ImageView>
<ListView android:padding="10dip" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/list1" >
</ListView>
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/top_solowarmups"
></ImageView>
<ListView android:padding="10dip" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/list2">
</ListView>
</LinearLayout>
</ScrollView>
请帮助我,提前谢谢
答案 0 :(得分:0)
在删除ScrollView标签后尝试.......你已经使用了2个listview,然后在android:layout_height =“fill_parent”中使用了wrap_content。
答案 1 :(得分:0)
两个ListView
都应wrap_content
。如果这不起作用,只需使用LinearLayout
来保存列表项。