Android:某些设备中未显示Unicode字符
我试图向textView显示格鲁吉亚拉里符号,但在某些设备中失败 在某些设备中,它如下所示: 应该是这样的: 这是我的密码。我尝试在activity.class和布局文件中:Android:某些设备中未显示Unicode字符,android,unicode,Android,Unicode,我试图向textView显示格鲁吉亚拉里符号,但在某些设备中失败 在某些设备中,它如下所示: 应该是这样的: 这是我的密码。我尝试在activity.class和布局文件中: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/priceText
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/priceTextView"
android:visibility="visible"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textSize="25sp"
android:textColor="@color/red"
android:textStyle="bold"
android:text="4 \u20BE"/>
我知道旧设备没有此符号,但我是否可以解决此问题?您可以将包含所需符号的字体文件附加到项目中
priceTextView.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/customFont.otf"));
您可以将包含所需符号的字体文件附加到项目中
priceTextView.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/customFont.otf"));
谢谢,伙计,成功了。但是,有什么方法可以使文本加粗,同时使用这种字体吗?好的,我找到了解决办法。在构造函数priceTextView.setTypeface(typeface.createFromAsset(getAssets(),“fonts/customFont.otf”),“typeface.BOLD”中添加了另一种字体。谢谢,它成功了。但是,有什么方法可以使文本加粗,同时使用这种字体吗?好的,我找到了解决办法。在构造函数priceTextView.setTypeface(typeface.createFromAsset(getAssets(),“fonts/customFont.otf”),“typeface.BOLD”)中添加了另一种字体