Android開發筆記之ArrayAdapter


1,ArrayAdapter的item中的條目的布局文件的正確寫法:

item.xml

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv_2"
android:layout_width="match_parent"
android:layout_height="match_parent" />

 

 

2,錯誤用法

不能像下面這樣使用布局,即不能在布局中使用

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_my"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>


</LinearLayout>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM