checkbox扩大点击范围以及一个监听器处理多个点击事件
1.现在不用在checkbox的id上面去监听点击直接在它的父类regist_showpassword_li监听
2.程序中控制checkbox的点击id添加一个点击的标识
private int showPwdSign = -1; // 标识用于记住密码扩大checkbox点击范围 -1代表没有点击1代表点击
regist_showpassword=(CheckBox)findViewById(R.id.regist_showpassword);
regist_showpassword_li = (LinearLayout)findViewById(R.id.regist_showpassword_li);
regist_showpassword_li.setOnClickListener(commonClickListener);
//这是的处理一个监听器处理多个监听事件
private OnClickListener commonClickListener = new OnClickListener() {<!-- 布局文件样式-->
<LinearLayout
android:id="@+id/regist_showpassword_li"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<CheckBox
android:id="@+id/regist_showpassword"
android:layout_width="15dp"
android:layout_height="15dp"
android:button="@null"
android:checked="false"
android:background="@drawable/member_register_showpwd_checkbox_selector"/>
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:text="@string/member_register_show_pwd_tv"
android:textColor="#9f9f9f"
android:textSize="12sp" />
</LinearLayout>