android listview布局文件,Android listview中嵌套Checkbox的布局文件

本文介绍了如何在 Android ListView 中嵌套 Checkbox 的布局实现,特别强调了设置比例、长度限制以及元素对齐方式。通过示例代码展示了如何调整各个组件的宽高,确保长文件名的适配,并保持布局的美观。同时,提到了点击事件的处理,以确保用户体验。
摘要由CSDN通过智能技术生成

Android listview中嵌套Checkbox的布局文件

效果图如下:

0818b9ca8b590ca3270a3433284dd417.png

需要注意的地方:

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

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

android:layout_width="fill_parent" android:layout_height="80dip"

android:orientation="horizontal" android:layout_weight="1">

android:layout_height="fill_parent" >

android:layout_height="40dip" android:layout_weight="1">

android:layout_height="wrap_content" android:text="程序名称 : ">

android:layout_toRightOf="@id/nameLab" android:layout_height="20dip"

android:layout_marginLeft="3dip" android:textColor="#FFD700">

android:layout_height="wrap_content" android:layout_below="@id/name"

android:text="安装时间:">

android:layout_height="wrap_content" android:layout_below="@id/name"

android:layout_alignLeft="@id/name" android:textColor="#FFD700">

android:layout_height="40dip" >

android:id="@+id/checkbox"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:clickable="true"

android:focusable="false"

android:focusableInTouchMode="false"/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值