0
런타임에 레이아웃을 빌드 중이므로 사용자에 대해 4 개의 라디오 버튼이있는 라디오 그룹을 보여야하지만, 라디오 버튼을 사용하여 편집 필드를 표시해야하는 경우가 있습니다. 사용자는 해당 라디오 버튼과 관련된 것을 편집 상자에 쓸 수 있습니다. 라디오 버튼 옆에 편집 필드를 표시하고 싶습니다. 편집 필드를 작성하려고했지만 라디오 그룹 아래에 계속 표시됩니다. 편집 텍스트가 포함 된 선형 레이아웃의 버튼 중 하나를 분리하면 라디오 그룹의 범위를 벗어납니다. 이 라디오 그룹 내가 옆에있는 라디오 버튼에 표시 할 런타임에 편집 필드를 만들 수있는 방법런타임에 라디오 그룹을 작성하십시오.
RadioGroup radioGroup = new RadioGroup(context);
radioGroup.setContentDescription(id);
for (int i = 0; i < vector.size(); i++) {
RadioButton radioButton = new RadioButton(context);
radioButton.setTextColor(Color.BLACK);
radioButton.setText("" + vector.get(i).getQ_text());
radioButton.setContentDescription(vector.get(i).getA_id());
radioButton.setTextSize(20);
radioButton.setTextColor(Color.parseColor("#A5462E"));
radioGroup.addView(radioButton);
radioGroup.setPadding(20, 0, 0, 0);
를 구축하기위한 코드입니다.