Android ArrayList ListView/Textview - You must supply a resource ID for a textview

后端 未结 2 1204
故里飘歌
故里飘歌 2021-01-24 10:41

I had this working at one point, so I think I\'m just referencing something wrong. _regionListView seems to be returning OK. I thought the array inside the ArrayList was the pro

相关标签:
2条回答
  • 2021-01-24 11:07

    write your search_list.xml like this

    <?xml version="1.0" encoding="utf-8"?>
    
        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@android:id/text1"
            android:cacheColorHint="#00000000"
            android:gravity="center"
            android:layout_gravity="left"
            android:layout_width="wrap_content"
            android:layout_height="60dp" 
            android:paddingLeft="10dip"
            android:textColor="#000000"
            android:typeface="sans"
            android:textSize="20dip"
            android:textStyle="bold"/>
    
    0 讨论(0)
  • 2021-01-24 11:20

    Remove LinearLayout from search_list.xml and use only textview and put this in textview itself

    xmlns:android="http://schemas.android.com/apk/res/android"
    

    There is no need of LinearLayou there and also you can set android:layout_height="wrap_content" .Then it will work. :)

    0 讨论(0)
提交回复
热议问题