Android listview中嵌套Checkbox的布局文件

效果图如下:



需要注意的地方:

1、设置比例 只是设置中间部分的比例

2、android:id="@+id/name"显示的是文件名称,比如像第二个长度太长,于是设置宽度为android:layout_height="20dip",这样多出来的字就不显示了


<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent" android:layout_height="80dip"      android:orientation="horizontal" android:layout_weight="1">          <ImageView android:id="@+id/icon" android:layout_width="wrap_content"          android:layout_height="fill_parent" ></ImageView>              <RelativeLayout android:layout_width="wrap_content"           android:layout_height="40dip" android:layout_weight="1">          <TextView android:id="@+id/nameLab" android:layout_width="wrap_content"              android:layout_height="wrap_content" android:text="程序名称 : "></TextView>          <TextView android:id="@+id/name"  android:layout_width="wrap_content"            android:layout_toRightOf="@id/nameLab" android:layout_height="20dip"              android:layout_marginLeft="3dip"  android:textColor="#FFD700"></TextView>          <TextView android:id="@+id/timeLab" android:layout_width="wrap_content"              android:layout_height="wrap_content" android:layout_below="@id/name"               android:text="安装时间:"></TextView>          <TextView android:id="@+id/time" android:layout_width="wrap_content"              android:layout_height="wrap_content" android:layout_below="@id/name"              android:layout_alignLeft="@id/name" android:textColor="#FFD700"></TextView>     </RelativeLayout>         <RelativeLayout android:layout_width="wrap_content"         android:layout_height="40dip" >         <CheckBox        android:id="@+id/checkbox"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:clickable="true"        android:focusable="false"        android:focusableInTouchMode="false"/>    </RelativeLayout></LinearLayout>


更多相关文章

  1. listview为空时,显示字符串
  2. Android之ListView属性描述
  3. 安卓开发学习之012 TextView高级应用
  4. Android知识点记录: 使用代码设置 android 上listView的条目的点
  5. Android中字体颜色的设置
  6. android UI进阶之弹窗的使用(2)--实现通讯录的弹窗效果
  7. Android(安卓)Layout XML属性
  8. Android中的lcd_density设置
  9. Launcher2

随机推荐

  1. Android(安卓)NDK开发使用以及so文件生成
  2. Google Android开发精华教程
  3. Android线程模型解析(包括UI的更新)
  4. android的编译和运行过程深入分析
  5. Android消息机制字典型探究(二)
  6. android window类
  7. Android中“分享”功能的实现
  8. Android内存溢出
  9. Android开发者e周报 第4期
  10. Android应用程序基础知识