iT邦幫忙

0

[android studio]Java 自定義對話框中的客製ListView

1

今天試著把預設的對話框選單改變成自定義畫面,把原本使用.setItems呈現的預設對話框主題,使用LayoutTnflater將自定義的layout替換進去https://ithelp.ithome.com.tw/upload/images/20210203/20132532CqoJfSEsc4.png

原本想偷懶使用.setAdapter(new ArrayAdapter(context,android.R.layout.simple_list_item_1,item));
卻沒有將我的item呈現出來,為一片空白。
https://ithelp.ithome.com.tw/upload/images/20210203/20132532yRpG2I8a1D.png

後來使用自定義的layout去設定ListView的內容
https://ithelp.ithome.com.tw/upload/images/20210203/20132532HUYzP66LwA.png

成功呈現出想要的內容
https://ithelp.ithome.com.tw/upload/images/20210203/20132532zIHItjBnNa.png


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言