歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android開發教程:ListView用法解析

Android開發教程:ListView用法解析

日期:2017/3/1 11:08:13   编辑:Linux編程

首先還是先把布局文件給大家貼出來

R.layout.frame.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent"
  5. android:paddingTop="1pt"
  6. android:paddingLeft="1pt"
  7. android:paddingRight="10pt"
  8. android:orientation="horizontal" >
  9. <TextView
  10. android:id ="@+id/appname"
  11. android:layout_width="fill_parent"
  12. android:layout_height="wrap_content"
  13. android:textSize="15pt"
  14. />
  15. </LinearLayout>

這是activity采用的布局文件,現在解釋一下中間幾個屬性的含義

android:orientation 指定LineatLayout 是橫向的還是縱向的 "vertical"縱向

android:drawSelectorOnTop 指定 容器是否畫在內容上方

選擇"false"

選擇"true"

Copyright © Linux教程網 All Rights Reserved