问题描述
- 小米2a,2s上 RadioButton自定义点击效果,会有很宽的默认间距
-
小米2a,2s上 RadioButton自定义点击效果,会有很宽的默认间距
遇到个很奇葩的问题,小米2a,2s上 RadioButton自定义点击效果后,默认会有个很宽的间距,在其他手机都没有这个间距。。
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.myexample.activityresult.MainActivity" ><RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/select" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00ff00" android:gravity="left" android:text="不限" /> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/select" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00ff00" android:gravity="left" android:text="男" /> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/select" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00ff00" android:gravity="left" android:text="女" /> </RadioGroup>
解决方案
1.@drawable/select 的pressed 是否有问题 2.是否可以通过给按钮组设置selector 相关的参数
解决方案二:
RadioButton 可以直接设置text啊
解决方案三:
你好,我也是遇到了这个问题,我想问问你是怎样解决这个问题的,谢谢
时间: 2024-08-31 17:22:58