请问各位大牛, 如果LinearLayout布局中有一个Listview, 文件名为activity_list.xml
<
?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="match_parent">     <ListView android:id="@android:id/list"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"/> </LinearLayout>
 
大牛们能否解释一下为什么在eclipse的graphical layout 中每个list有两行显示呢,subItem 从哪里来的?
此时如果一个Activity 继承自listActitivity, 同时 setContentView(R.layout.activity_list);请问这个时候ArrayAdapter 将如何写:第一我写成
ArrayAdapter<Article> adapter =
new ArrayAdapter<Article>(activity,R.layout,activity_list, articleArrayList);结果运行得到 Error:
You must supply a resource ID for a TextView。
java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView请问这个是由于没给subitem赋值造成的吗?第二次我改成
ArrayAdapter<Article> adapter =
new ArrayAdapter<Article>(activity,android.R.layout.simple_list_item_1,articleList);程序顺利运行但是显示结果只有一行,没有出现subItem.请问谁能解释一下,到底那种arrayadapter写法是正确的?谢谢。andorid