1

我是 Android 新手并创建了一个应用程序,它将使用 RadioButtons 进行选择并做一些工作,我能够从字符串数组创建 RadioButons 并能够从选定的 RadioButtons 中获取 id 但现在我需要在选择后从 RadioGroup 中删除 RadioButtons

这是我使用的代码

            for(int i =0; i<ab.length;i++)
            {
                RadioButton radioButtonView = new RadioButton(this);
                radioButtonView.setText(ab[i]);
                radioGroup.addView(radioButtonView, p);
            }   

我能够将新数组映射到 RadioButtons 但无法删除旧数组(RadioButtons)请帮助,所以我将继续使用我的应用程序继续谢谢

4

1 回答 1

0

使用RadioGroup.removeViewAt(int index)RadioGroup.removeView(View view)RadioGroup.removeViews(int start, int count)

于 2015-01-24T10:57:25.000 回答