You must supply a resourceID for a TextView
生活随笔
收集整理的這篇文章主要介紹了
You must supply a resourceID for a TextView
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題:
新手在初次接觸ListView時候喜歡采用簡單的ArrayAdpter,由于布局文件xml書寫不正確,經常會出現You must supply a resourceID for a TextView的錯誤。
解決途徑:
我們只需要按照安卓官方示例代碼里的xml布局文件來修改一下即可,請不要增加或減少textview之類的,因為這和ArrayAdapter的機制有關。
<?xml version="1.0"?encoding="utf-8"?>
<TextViewxmlns:android="http://schemas.android.com/apk/res/android"
????android:layout_width="fill_parent"
????android:layout_height="fill_parent"
????android:padding="10dp"
????android:textSize="16sp">
</TextView>
總結
以上是生活随笔為你收集整理的You must supply a resourceID for a TextView的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为:当前 5G 三年发展成果等于 4G
- 下一篇: Activity的task相关