首页 > 移动平台 > 详细

Android listview中嵌套Checkbox的布局文件

时间:2014-03-01 13:33:50      阅读:564      评论:0      收藏:0      [点我收藏+]

Android listview中嵌套Checkbox的布局文件

效果图如下:

bubuko.com,布布扣


需要注意的地方:

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>


Android listview中嵌套Checkbox的布局文件,布布扣,bubuko.com

Android listview中嵌套Checkbox的布局文件

原文:http://blog.csdn.net/itas109/article/details/20158069

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!