问题描述
我使用下面的代码在android中显示卢比
字体face = Typeface.createFromAsset(getAssets(),Rupee_Foradian.ttf);
errormsgtodisplay.setTypeface(face);
errormsgtodisplay.setText(你的现金余额是+ getResources()。getString(R.string.rs)+ otherinformation);
它工作正常但它也改变了文字的字体样式你的现金余额我希望该文字应该使用以前的字体样式而不是 Rupee_Foradian的字体样式。 ttf
i display rupee in android using below code
Typeface face = Typeface.createFromAsset(getAssets(), "Rupee_Foradian.ttf");
errormsgtodisplay.setTypeface(face);
errormsgtodisplay.setText("Your Cash Balance is " + getResources().getString(R.string.rs)+otherinformation);
it works fine but it also changes font style of text Your Cash Balance is i want that text should use previous font style not that of Rupee_Foradian.ttf
推荐答案
<string name="rupee">\u20B9</string>
或
or
<string name="rupee">\u20A8</string>
String string = "\u20B9";
byte[] utf8 = null;
utf8 = string.getBytes("UTF-8");
string = new String(utf8, "UTF-8");
稍后再谢谢
Thank me later
这篇关于在android中的卢比符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!