更改文本视图上的单词

时间:2013-05-30 16:01:54

标签: java android

我有一个问题 - 我使用网络服务在TextView中显示一些信息,但在很多文本中我都有像“Ž”这样的字样,当我在设备上显示时,该字符看起来像“?”。我想知道如何将这个“Ž”改为另一个角色以正确显示它。

这是我的主要内容:

TextView text1=(TextView)vi.findViewById(R.id.textView1);  
TextView text2=(TextView)vi.findViewById(R.id.textNom);
TextView text3=(TextView)vi.findViewById(R.id.textPost);
TextView text4=(TextView)vi.findViewById(R.id.textDdn);

text1.setText(players.getNm()); 
text2.setText(Html.fromHtml( players.getNom()).toString());
text3.setText(Html.fromHtml( layers.getPost()).toString());
text4.setText(players.getDdn());

这是我的xml文件:

<TextView
    android:id="@+id/textPost"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textDdn"
    android:layout_below="@+id/textDdn"
    android:layout_centerInParent="true"
    android:ellipsize="end"
    android:text="Wydad_Test"
    android:textColor="#000" />

<TextView
    android:id="@+id/textNom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/imageView1"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="28dp"
    android:text="Wydad_Test"
    android:textColor="#000"
    android:textStyle="bold" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/textPost"
    android:layout_alignLeft="@+id/imageView1"
    android:layout_alignTop="@+id/textNom"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="26dp"
    android:layout_toLeftOf="@+id/textDdn"
    android:gravity="center"
    android:text="Wydad_Test"
    android:textColor="#000"
    android:textSize="30dp"
    android:textStyle="bold" />

0 个答案:

没有答案