今天碰到一个很诡异的问题:listview里面的adapter有4行数据,可是在页面上无论如何只能显示list.get(0)的数据,其他三项无法显示。
原来,android在layout布局文件的开头里面,有一行这个东西
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
原来,android在layout布局文件的开头里面,有一行这个东西
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
当有了这个属性之后,该布局文件里面的listview,无论如何,只能显示一行。把它删去,问题解决。
当listview在scrollview内部时,listview只会显示一行。