radiobutton-小米2a,2s上 RadioButton自定义点击效果,会有很宽的默认间距

问题描述

小米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>

小米2a效果图

华为手机效果

解决方案

1.@drawable/select 的pressed 是否有问题 2.是否可以通过给按钮组设置selector 相关的参数

解决方案二:

RadioButton 可以直接设置text啊

解决方案三:

你好,我也是遇到了这个问题,我想问问你是怎样解决这个问题的,谢谢

时间: 2024-08-31 17:22:58

radiobutton-小米2a,2s上 RadioButton自定义点击效果,会有很宽的默认间距的相关文章

小米手机2不限量购买 或为迎接小米2A/2S/红米?

&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;   小米手机2自去年8月发布以来,一直是国内热点很高的手机,每次官网开放购买都会吸引大批用户抢购,每次都在短短几分钟内被抢购一空,不少用户还因为多次抢购失败而高价购买"黄牛机". 不过经历了半年的火热后,这次似乎冷下来了:     在3月27日,也就是本周抢购后的第二天,小编在小米官网上发现了小米手机2依然可以购买,便启用了并没有预订过的小米账号

Android之Button自定义点击效果

        我们在界面上经常会用到button按钮,但通常button点击后看不到点击的效果,如果用户连续点击了两次,就会报NAR错误,这样交互性就比较差了.如果我们自定义了button点击效果,比如我们点击了button能让我们看到我们确实点击了button按钮,这样就会有效的避免重复点击了.               自定义点击效果有两种方式,一种是在xml中定义,另一种是在代码中定义.              首先看一下如何在xml中定义:              在drawab

Android中的Button、ImageButton自定义点击效果

使用Button时为了让用户有"按下"的效果,有两种实现方式: 1.在代码里面. imageButton.setOnTouchListener(new OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN){ //更改为按下时的背景图片 v.setBackgroundResource(

Android中的Button自定义点击效果实例代码_Android

方法一1.放在drawable下的selector.xml文件 复制代码 代码如下: <android="http://schemas.android.com/apk/res/Android">    android:drawable="@drawable/temp2" /> 2.布局文件main.xml 复制代码 代码如下: <http://schemas.android.com/apk/res/android"    andro

Android中的Button自定义点击效果实例代码

方法一1.放在drawable下的selector.xml文件复制代码 代码如下:<android="http://schemas.android.com/apk/res/Android"> android:drawable="@drawable/temp2" /> 2.布局文件main.xml复制代码 代码如下:<http://schemas.android.com/apk/res/android"    android:orie

Android自定义button点击效果的两种方式_Android

我们在界面上经常会用到button按钮,但通常button点击后看不到点击的效果,如果用户连续点击了两次,就会报NAR错误,这样交互性就比较差了.如果我们自定义了button点击效果,比如我们点击了button能让我们看到我们确实点击了button按钮,这样就会有效的避免重复点击了. 自定义点击效果有两种方式,一种是在xml中定义,另一种是在代码中定义. 首先看一下如何在xml中定义: 在drawable下新建selector.xml文件:          <?xml version="

Android自定义button点击效果的两种方式

我们在界面上经常会用到button按钮,但通常button点击后看不到点击的效果,如果用户连续点击了两次,就会报NAR错误,这样交互性就比较差了.如果我们自定义了button点击效果,比如我们点击了button能让我们看到我们确实点击了button按钮,这样就会有效的避免重复点击了. 自定义点击效果有两种方式,一种是在xml中定义,另一种是在代码中定义. 首先看一下如何在xml中定义: 在drawable下新建selector.xml文件: <?xml version="1.0"

radio button-为甚RadioButton在红米手机上不能跑

问题描述 为甚RadioButton在红米手机上不能跑 报错:Error inflating class android.widget.RadioButton 把这段删了就能跑 <RadioGroup android:id="@+id/rg_01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLef

使用DownloadManager下载数据,在小米2s上Cursor泄露了,求解

问题描述 使用DownloadManager下载数据,在小米2s上Cursor泄露了,求解 使用DownloadManager下载数据,在小米2s上Cursor泄露了,求解 解决方案 是的,这个只能在2.3及以上版本使用.但是,可以把它的源码拿过来阅读,进行改写实现自己的下载. 另外对于内置于系统的应用,还是可以使用这个DownloadProvider的.