0

我在RelativeLayout 中有一个RadioGroup。我有几个 RadioButtons 用于不同的选项,例如“Bob”、“Joe”和“Fred”。但是,我需要在 RadioButton 旁边添加一个带有 EditText 的“Other...”选项,以防用户想要输入“Steve”。有没有办法做到这一点?

4

1 回答 1

1

想到的一个想法是使用android:layout_marginLeftandroid:layout_marginTop标记将EditText字段定位在您需要的位置。请务必使用dip来支持跨设备的多种密度。

<EditText
    android:layout_marginLeft="65dip"
    android:layout_marginTop="100dip"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="" />

然后,如果用户选择您的其他单选按钮,只需从EditText.

于 2010-11-21T23:58:45.240 回答