[問題] SimpleAdapter 與 ListView
我想要做的只是
歡迎使用本軟體 (TextView)
(以下為ListView)
選項一(ListView)
台視 (Sub Item)
選項二(ListView)
中視 (Sub Item)
選項三(ListView)
華視 (Sub Item)
選項四(ListView)
公視 (Sub Item)
我在 Layout 是這樣佈置
<LinearLayout
<TextView android:id="@+id/textView" />
</LinearLayout>
然後語法是用 ListActivity + SimpleAdapter
//新增SimpleAdapter
adapter = new SimpleAdapter(
this,
list,
android.R.layout.simple_list_item_2,
new String[] { "option","tv" },
new int[] {android.R.id.text1, android.R.id.text2} );
只是在 onCreate 下
加了 setContentView(R.layout.main); 就會錯誤
不加就可以正常執行
想請問 只是要多一個 TextView 的話
怎樣做才是最好的方式呢?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.124.77.157
→
03/11 19:41, , 1F
03/11 19:41, 1F
→
03/11 19:44, , 2F
03/11 19:44, 2F
推
03/12 01:56, , 3F
03/12 01:56, 3F
推
03/12 02:00, , 4F
03/12 02:00, 4F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):