[英]How to remove an item from an ListView programmatically in Android?
[英]How to change ListView Item programmatically in Android?
我有一個 ListView,我想以編程方式更改它的列表項。 有沒有辦法做到這一點? 先感謝您。
這是我的 ListView XML 代碼。
<ListView
android:id="@+id/foodsListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@android:color/transparent"
android:stackFromBottom="false"
android:transcriptMode="disabled"
tools:listitem="@layout/item_food">
</ListView>
這是我想要展示的而不是item_food
:
"R.layout.item_message"
使用 RecyclerView 而不是 ListView。 它是為這個 t 創建的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.