You are here Android > 开发者 > 开发讨论 > 自定义含有checkbox的listview

机器人


93.089%

disconnected
登录后回复主题 | 跳到回复

自定义含有checkbox的listview

... by 机器人 ... 29 月 9 天前 ... 1171 次点击

listview的item描述
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ? androidrientation="horizontal"
? ? android:layout_width="fill_parent"
? ? android:layout_height="fill_parent"
? ? >
<CheckBox
? ? android:id="@+id/widget_checkbox"
? ? android:layout_width="wrap_content"
? ? android:layout_height="wrap_content"
? ? android:focusable="false"
? ? >
</CheckBox>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
? ? android:id="@+id/widget_text"
? ? android:layout_width="fill_parent"
? ? android:layout_height="fill_parent"
? ? android:textStyle="bold"
? ? android:textSize="18px"
? ? android:gravity="center_vertical"
? ? androidaddingLeft="10px"
? ? android:singleLine="true"
/>
</LinearLayout>

现在情况是,点击listview的item时,(点击范围是非checkbox处), 会激活onListItemClick 事件.
而点击checbox无法激活这个事件, 请问是怎么回事. 或者有什么变通方式

目前这个主题还没有回复,或许你可以帮楼主加盖一层?

在回复之前你需要先进行登录
电子邮件或昵称
密码
当前热门主题  有谁想学习利用ksoap2连接webService远程接口吗? ... 12 篇回复
© 2009 A Nanshapo Production   -   About
a site powered by Project Babel