消除多余的右填充上杰利贝恩API级别16三星Galaxy S3的Andr​​oid单选按钮 [英] Eliminate extra right padding android radio button on Samsung Galaxy S3 on Jellybean API Level 16

查看:91
本文介绍了消除多余的右填充上杰利贝恩API级别16三星Galaxy S3的Andr​​oid单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上杰利贝恩API级别16.(见截图)在三星Galaxy S3跑我看到在单选按钮上额外的右填充。任何想法如何消除这种额外的右填充?

I am seeing extra right padding on radio buttons when ran on Samsung Galaxy S3 on Jellybean API Level 16. (see screenshot). Any idea how to eliminate this extra right padding?

可能与此问题:<一href=\"http://stackoverflow.com/questions/18575923/android-checkbox-extra-padding-on-touchwiz\">Android复选框上的TouchWiz 微胖

布局XML看起来是这样的:

Layout XML looks like this:

<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#ff0000">
    <RadioButton
        android:id="@+id/stw_no_thanks_radio"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="0dp"
        android:layout_margin="0dp"
        android:drawablePadding="0dp" />
</FrameLayout>

感谢。

推荐答案

这似乎与16 API和较低的问题。 API 17不包括此额外的空间。

This seems to be an issue with API 16 and lower. API 17 doesn't include this extra space.

另外,问题似乎并没有具体到三星(我是能够重现该问题在模拟器)。

Also the issue doesn't seem specific to Samsung (I was able to reproduce the issue in the emulator).

下面是我的解决办法,不知道这是否是最好的,但它解决了我的问题:

Here is my workaround, not sure if it is the best, but it solved my problem:

layout.xml

<RadioButton
    android:id="@+id/radio_button"
    android:layout_width="@dimen/radiobutton_width"
    android:layout_height="@dimen/radiobutton_height"
    android:padding="0dp"
    android:layout_margin="0dp" />

值/ dimens.xml

<dimen name="radiobutton_width">38dp</dimen>
<dimen name="radiobutton_height">48dp</dimen>

值-V14 / dimens.xml

<dimen name="radiobutton_width">32dp</dimen>
<dimen name="radiobutton_height">42dp</dimen>

值-V17 / dimens.xml

<dimen name="radiobutton_width">-2dp</dimen> <!-- WRAP_CONTENT -->
<dimen name="radiobutton_height">-2dp</dimen> <!-- WRAP_CONTENT -->

这篇关于消除多余的右填充上杰利贝恩API级别16三星Galaxy S3的Andr​​oid单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆