radiogroup多⾏多列互斥
1.⾸先⽤多个radiogroup,id都不可重复包括group和⼦项ID
2.每个radiobutton增加事件
public void rdClick(View view) {
RadioGroup rdTmp = (RadioGroup) findViewById(R.id.radioGroup1); RadioGroup rdTmp2 = (RadioGroup) findViewById(R.id.radioGroup2); rdTmp.clearCheck();
rdTmp2.clearCheck();
for (int i = 0; i < ChildCount(); i++) {
boolean isFocus = ChildAt(i).isPressed();
RadioButton rdChildTmp = (RadioButton) ChildAt(i); setRdoCheckid(rdChildTmp, isFocus);
// ShowMessage(String.valueOf(isFocus));
}
for (int i = 0; i < ChildCount(); i++) {
boolean isFocus = ChildAt(i).isPressed();
RadioButton rdChildTmp2 = (RadioButton) ChildAt(i); setRdoCheckid(rdChildTmp2, isFocus);
// ShowMessage(String.valueOf(isFocus));
}
}
private void setRdoCheckid(RadioButton rdoControl, boolean isCheckd) { if (isCheckd) {
this.selectRdo = rdoControl;
//Text());
rdoControl.setChecked(true);
}htmlradio添加切换事件
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论