开发者

Japanese Characters display weird spacing in Android TextView and Buttons

I'm trying to localize an android app to Japanese. I dropped in the japanese strings xml file and everything is pretty good except for Katakana characters with the two little dashes or the little circle in the top right. For those characters the display takes up the width of 2 full characters.

Here's a simple example showing the spacing problem with the word "website" in katakana:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
>
    <TextView  
        android:la开发者_C百科yout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="ウェブサイト"       
        android:typeface="normal"/>
</LinearLayout>

When it displays on the phone, the 3rd character takes up an extra space. Any ideas what's going wrong?


Try change the character "ブ" -> "ブ".
The 3rd character is not used ordinary Japanese in UTF-8.


Try externalizing the string into strings.xml. Doing that I don't have this problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜