注意事项:
首先自定义ChoiceView类实现Checkable接口
public class ChoiceView extends FrameLayout implements Checkable{
private TextView mTextView;
public RadioButton mRadioButton;
public ChoiceView(Context context) {
super(context);
View.inflate(context, R.layout.listview_installment_item, this);
mTextView = (TextView) findViewById(R.id.tv_qishu);
mRadioButton = (RadioButton) findViewById(R.id.radiobtn);
}
public void setText(String text) {
mTextView.setText(text);
}
@Override
public void setChecked(boolean checked) {
mRadioButton.setChecked(checked);
}
@Override
public