Android(安卓)listview中嵌套Checkbox的布局文件
16lz
2021-12-04
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>
更多相关文章
- listview为空时,显示字符串
- Android之ListView属性描述
- 安卓开发学习之012 TextView高级应用
- Android知识点记录: 使用代码设置 android 上listView的条目的点
- Android中字体颜色的设置
- android UI进阶之弹窗的使用(2)--实现通讯录的弹窗效果
- Android(安卓)Layout XML属性
- Android中的lcd_density设置
- Launcher2