안녕하세요.
RadioGroup 그룹으로 데이터를 받아서 Radio button 에 text 를 붙여주었습니다.
하지만 핸드폰마다 글씨가 떨어져서 나오는가 하면 어떤건 딱 달라 붙어서 나오게 되는데요.
혹시 동적으로 라디오 버튼 과 텍스트뷰를 만들어서 RelativeLayout android:layout_toRightOf 효과를 주어서 라디오 버튼위치 옆에 텍스트뷰를 위치 시킬수 있는 방법이 있을까요? ㅠㅠ
계속 시도는 해보고 있는데 잘안되네요 ㅠㅠㅠ
고수님 조언좀 부탁드립니다.
public class MainActivity extends Activity
{
private RadioGroup radioGroup = null;
private LinearLayout texts = null;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
radioGroup = (RadioGroup) findViewById(R.id.module_radio);
texts = (LinearLayout)findViewById(R.id.dddd);
ArrayList<String> comboBoxInfo = new ArrayList<String>();
comboBoxInfo.add("사과");
comboBoxInfo.add("배");
comboBoxInfo.add("감");
comboBoxInfo.add("귤");
for (int i = 0; i < comboBoxInfo.size(); i++) {
LayoutParams layout = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
RadioButton radio = new RadioButton(this);
radio.setLayoutParams(layout);
TextView text = new TextView(this);
text.setText(comboBoxInfo.get(i));
text.setTextColor(Color.BLACK);
radioGroup.addView(radio);
radioGroup.addView(text);
}
}
}
지금은 결과값
-------------------------------------------
라디오버튼
사과
라디오버튼
배
라디오버튼
감
라디오버튼
귤
-------------------------------------------
원하는결과 값
--------------------------------------------
라디오버튼 사과
라디오버튼 배
라디오버튼 감
라디오버튼 귤
--------------------------------------------
도움요청좀 드립니다 ㅠㅠ