现在的位置: 首页 > 综合 > 正文

Android开发 ——线性布局文件、TextView、ListView的基本写法

2013年10月21日 ⁄ 综合 ⁄ 共 843字 ⁄ 字号 评论关闭
<?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="horizontal" 
    android:padding="10dp">
    
     <ListView
        android:id="@+id/personLV"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />
    
    <TextView android:id="@+id/idTV"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="1"
        android:textSize="20sp"/>
    
    <TextView android:id="@+id/nameTV"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="2"
        android:text="张三"
        android:textSize="20sp"/>
    
    <TextView android:id="@+id/balanceTV"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="2"
        android:text="50000"
        android:textSize="20sp"/>

</LinearLayout>

抱歉!评论已关闭.