RadioButton能把字体放在按钮的前面吗? 如题:男生 ⊙女生 ⊙ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 据我所知 RadioButton 应该没有这个属性,你把这个RadioButton的text设为空,然后在他的前面加一个CheckedTextView可以吗? 但是RadioButton是在RadioGroup里啊, 刚才试了下,RadioGroup里不能放布局,放了之后就不是单选了 android:button="@null" android:drawableRight="@android:drawable/xxxxx" android:paddingLeft="30dip" android:text="男生" 还有我的radiobutton是自己定义的样式,好像不可以啊, <?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/danxuan1" android:state_checked="true" android:state_enabled="true" ></item> <item android:drawable="@drawable/danxuan2" android:state_checked="false" android:state_enabled="true"></item></selector>=========================================================== <style name="RadioButtonStyles" > <item name="android:button">@drawable/myradio</item> </style>=============================================================<RadioButton android:id="@+id/onlybig" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello" style="@style/RadioButtonStyles" /> 可以在FrameLayout里面添加2个Linearlayout实现第1个LinearLayout放置2个TextView,分别显示男生、女生第2个Linearlayout放置1个RadioGroup,放设置里面的RadioButton的text为空字符也可以通过TableLayout分2列实现。RadioGroup不规则布局还可参考:http://blog.csdn.net/aminfo/article/details/7558308 采用的8楼的就是对其的时候不好控制,要自己另加上radiobutton上的内容了 我的方法虽然有些笨,希望给你帮助在RadioGroup里的RadioButton中:1.设置android:button="@null"2.设置布局的左边空白处为-36dp3.设置@android:drawable/btn_radio右对齐现在RadioButton中文本在左边,按钮在右边。 如何去掉乐Phone progressdialog上的取消按钮 ARGB_8888 android应用如何实现连接客户的服务器 关于android 知道图片名字怎么获得图片 自定义一个textview,如何在listview中作为每一项去使用? Android性能调优总结 Android listview 数据库动态先进度条的问题 安卓下替换word文档中的图片 React Native的PermissionsAndroid组件如何避免连续提示的情况? 百度地图移动到指定点 ADK相关问题
android:drawableRight="@android:drawable/xxxxx"
android:paddingLeft="30dip"
android:text="男生"
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/danxuan1" android:state_checked="true" android:state_enabled="true" ></item>
<item android:drawable="@drawable/danxuan2" android:state_checked="false" android:state_enabled="true"></item>
</selector>
===========================================================
<style name="RadioButtonStyles" >
<item name="android:button">@drawable/myradio</item>
</style>
=============================================================<RadioButton
android:id="@+id/onlybig"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
style="@style/RadioButtonStyles"
/>
第1个LinearLayout放置2个TextView,分别显示男生、女生
第2个Linearlayout放置1个RadioGroup,放设置里面的RadioButton的text为空字符也可以通过TableLayout分2列实现。RadioGroup不规则布局还可参考:
http://blog.csdn.net/aminfo/article/details/7558308
在RadioGroup里的RadioButton中:
1.设置android:button="@null"
2.设置布局的左边空白处为-36dp
3.设置@android:drawable/btn_radio右对齐
现在RadioButton中文本在左边,按钮在右边。