繁体   English   中英

如何在单选按钮中放置EditText和TextView?

[英]How can I place an EditText and TextView in a RadioButton?

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

想到的一个想法是使用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获取值。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM