简体   繁体   English

索尼Xperia设备上的复选框文本有问题

[英]Problem with Checkbox text on Sony Xperia device

I am displaying a Checkbox on a layout xml. 我在布局xml上显示一个复选框。

The Checkbox text contain around 10 characters. 复选框文本包含大约10个字符。

The problem is specific to Sony Xperia where the the Checkbox text is coming to the second line , specifically last 2 characters of the text on the second line. 此问题特定于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>

I have tested the mobile application on HTC Hero , Google Nexus One , Motorola Droid ,etc , but its working fine without any problem. 我已经在HTC Hero,Google Nexus One,摩托罗拉Droid等产品上测试了移动应用程序,但其运行正常,没有任何问题。

The problem is not getting reflected on the Sony Xperia emulator too. 该问题也未在Sony Xperia模拟器上得到反映。

Is adding the code, android:singleLine="true" , solve the issue , if it means that after a certain no of characters "..." will be added but the text will be in a single line ? 是否正在添加代码android:singleLine =“ true”来解决问题,如果这意味着在没有一定数量的字符“ ...”之后将添加字符,但文本将在一行中呢?

I don't have a mobile device to currently test. 我目前没有要测试的移动设备。

Thanks in advance. 提前致谢。

Warm Regards, 温暖的问候,

CB 认证机构

If I understand you right, then you want the label of your checbox to not have multiple lines. 如果我理解正确,那么您希望Checbox的标签没有多行。 If so you should use android:lines="1" instead of android:singleLine="true" , because that is deprecated. 如果是这样,您应该使用android:lines="1"而不是android:singleLine="true" ,因为这已被弃用。 Usually that shouldn't break the behaviour, but I don't know if Sony did some "optimizition" on that ;) You could also try using android:inputType="text" , I'm not quite sure if that would be helpful though... 通常,这不应该破坏行为,但是我不知道索尼是否对此做了一些“优化”;)您也可以尝试使用android:inputType="text" ,我不确定这是否会有所帮助虽然...

Hope I understood your problem right ... 希望我理解你的问题吧...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM