android 单选框如何动态渲染?-灵析社区

七厦

RadioGroup radioGroup = findViewById(R.id.radioGroup); for (String option : optionsFromServer) { RadioButton radioButton = new RadioButton(this); radioButton.setText(option); radioButton.setId(View.generateViewId()); radioGroup.addView(radioButton); }

阅读量:1

点赞量:0

问AI