Android的单选问题安卓4.0单选、问题、Android

2023-09-06 13:42:41 作者:寄逍遥

我有一个简单的应用程序。屏幕是建立一个RelativeLayout的内部。我有更多的 的LinearLayout(S),其中一人给出了2单选按钮(S),像这样的:

I have a simple application. The screen is build inside a RelativeLayout. I have more LinearLayout(s), one of them shows the 2 RadioButton(s), like this:

        <LinearLayout android:layout_width="match_parent" android:layout_height="fill_parent"
            android:padding="3dp" android:gravity="center">
            <RadioGroup android:id="@+id/rgrDayToReport" 
                android:orientation="horizontal" 
                android:layout_width="wrap_content" android:layout_height="wrap_content">
                <RadioButton android:checked="true" android:id="@+id/rbtnToday"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"

                    android:text="@string/radioTodayText"/>
                <RadioButton  android:id="@+id/rbtnYesterday"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"

                    android:text="@string/radioYesterdayText"/>
            </RadioGroup>
        </LinearLayout>

该面板在任何设备上正确显示(像我一样的测试),除了三星Galaxy S3。在这个设备(只有在此设备)屏幕看起来是这样的:

This panel render correctly in any device (as I did tests) except Samsung Galaxy s3. On this device (only on this device) the screen looks like this:

我应该如何解决这个问题?

推荐答案

我遇到同样的问题。保留默认值 - 我已经通过不设置以下属性来的单选按钮和复选框解决了这一点。 以下属性来从上所有手机的绘制和从银河S3左上角计数。同时设置背景是造成银河S3相同的错误。保留默认值后,它现在可以使用随处可见。

I was experiencing the same problem. I have solved this by NOT setting paddingLeft on RadioButtons and CheckBoxes - leaving default value. paddingLeft was counted from the drawable on all phones and from left corner on Galaxy S3. Also setting background was causing the same bug on Galaxy S3. After leaving default values it's now usable everywhere.

 
精彩推荐