开发者

Problem with Checkbox text on Sony Xperia device

I am displaying a Checkbox on a layout xml.

The Checkbox text contain around 10 characters.

The pro开发者_开发技巧blem 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.

<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.

The problem is not getting reflected on the Sony Xperia emulator too.

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 ?

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. If so you should use android:lines="1" instead of android:singleLine="true", because that is deprecated. 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...

Hope I understood your problem right ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜