Android 将ListView项拆分为两列
我想在ListView中拆分一个项目,以获得与三星联系人电话列表中ListView相同的结果: 单击左/右列时,只有该列的背景更改。我尝试将一个图像按钮插入到一列列表视图中,但如果不直接单击该按钮,整行的背景会发生变化(包括ImageButton的背景)Android 将ListView项拆分为两列,android,listview,android-listview,Android,Listview,Android Listview,我想在ListView中拆分一个项目,以获得与三星联系人电话列表中ListView相同的结果: 单击左/右列时,只有该列的背景更改。我尝试将一个图像按钮插入到一列列表视图中,但如果不直接单击该按钮,整行的背景会发生变化(包括ImageButton的背景) 如何获得与三星相同的列表视图?我使用了这段代码,它对我很有用 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:la
如何获得与三星相同的列表视图?我使用了这段代码,它对我很有用
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3" >
<Button
android:id="@+id/text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:drawableRight="@drawable/ic_launcher"
android:gravity="center_vertical"
android:text="trtrtrt" />
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_launcher" />
</LinearLayout>
在列表的xml中使用
android:listSelector=“@null”
,如果它不起作用,那么如果您可以发布它,我想查看一下您的代码