怎样在ListView里面布局实现这样的效果 ListView怎么布局啊?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用PreferenceScreen,具体方法搜索一下吧 http://blog.csdn.net/ch_984326013/article/details/6628951 如果是标准设置的activity,那么只要用PreferenceActivity就可以了,如果是自己布局,那么参考xml如下:<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dip"> <CheckBox android:id="@+id/cb_select" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content"> </CheckBox> <LinearLayout android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="wrap_content" android:layout_toLeftOf="@id/cb_select" android:paddingLeft="10dip"> <TextView android:text="This is the title" android:textColor="#FFFFFFFF" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="24sp"> </TextView> <TextView android:text="This is the sumary" android:textColor="#FF7F7F7F" android:layout_width="wrap_content" android:layout_height="wrap_content"> </TextView> </LinearLayout></RelativeLayout>另外,你需要写CheckBox的监听,需要设置ListView的属性android:focusable="false" android:focusableInTouchMode="false",否则它的ItemClick会监听不到。 PreferenceScreen就可以了哇,楼上的那个分享到新浪微博是人家图片上的效果。 关于android2.3, density问题,请高手指点 2.3新添加了一个重载的MotionEvent.obtain(),如何利用这个API模拟两点放大缩小操作 在android里解析xml非常慢,这是为什么? android桌面快捷方式问题,在线等!!! Android系统原理与开发要点详解 安卓各控件的属性值 Android橡皮擦 关于程序内置输入法的问题 ffmpeg可以做rtsp服务器吗? android 怎么使用h5的video标签 Android项目的目录设置问题 关于ListView动态刷新的问题
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:padding="5dip">
<CheckBox android:id="@+id/cb_select"
android:layout_alignParentRight="true" android:layout_width="wrap_content"
android:layout_height="wrap_content">
</CheckBox>
<LinearLayout android:layout_width="fill_parent"
android:orientation="vertical" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/cb_select" android:paddingLeft="10dip">
<TextView android:text="This is the title" android:textColor="#FFFFFFFF"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="24sp">
</TextView>
<TextView android:text="This is the sumary" android:textColor="#FF7F7F7F"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</RelativeLayout>另外,你需要写CheckBox的监听,需要设置ListView的属性android:focusable="false" android:focusableInTouchMode="false",否则它的ItemClick会监听不到。