0
라디오 그룹의 라디오 버튼 확인 상태를 가져 오거나 설정할 수 있습니까?그룹에있을 때 라디오 버튼 값을 설정하는 방법은 무엇입니까?
xyzButtoninGroup.setChecked(true)
라디오 그룹의 라디오 버튼 확인 상태를 가져 오거나 설정할 수 있습니까?그룹에있을 때 라디오 버튼 값을 설정하는 방법은 무엇입니까?
xyzButtoninGroup.setChecked(true)
이 코드는 자체 instanceof를의
int count = radioGroup.getChildCount();
for (int i = 0; i < count; i++) {
View o = radioGroup.getChildAt(i);
if (o instanceof RadioButton) {
RadioButton radioBtn = (RadioButton)o;
// get the state
boolean isChecked = radioBtn.isChecked()
// to set the check
radioBtn.setChecked(true);
}
}
각 버튼마다 고유 한 ID가 있습니다. 당신은
한 좋은 사용을 설명 생각 (그들은 자신에, 같은 그룹에있는 경우 다른 사람이 취소됩니다) ID로 설정하십시오 – MKJParekh