Sony Xperia设备上的复选框文本出现问题

时间:2011-04-21 13:27:40

标签: android

我在布局xml上显示一个复选框。

复选框文本包含大约10个字符。

问题是Sony Xperia特有的,其中Checkbox文本到达第二行,特别是第二行文本的最后2个字符。

<CheckBox android:id="@+id/roundCheck" android:paddingLeft="25dip"
            android:button="@drawable/ic_uncheck_rect" android:layout_height="wrap_content"
            android:layout_width="wrap_content" 
            android:layout_marginLeft="20dip" android:text="abcdefghij"
            android:textSize="16sp"
            android:textColor="@color/white" android:typeface="serif"
            android:singleLine="true" android:checked="false"
            android:layout_centerVertical="true"></CheckBox>

我已经在HTC Hero,Google Nexus One,Motorola Droid等上测试了移动应用程序,但它的工作正常没有任何问题。

这个问题也没有反映在Sony Xperia仿真器上。

添加代码, android:singleLine =“true”,解决问题,如果这意味着在添加了一定数量的字符之后将添加“...”,但文本将会是在一行?

我目前没有移动设备进行测试。

提前致谢。

温暖的问候,

CB

1 个答案:

答案 0 :(得分:1)

如果我理解你的话,那么你希望你的checbox的标签没有多行。如果是这样,您应该使用android:lines="1"而不是android:singleLine="true",因为这已被弃用。 通常这不应该打破行为,但我不知道索尼是否对此做了一些“优化”;) 您也可以尝试使用android:inputType="text",我不太确定这是否有用......

希望我理解你的问题......