Man*_*gde 77 android android-fonts
我正在开发一个应用程序.我需要在文本视图上设置印度卢比的符号,该文本视图设置为金额.
符号:

我在Assets/fonts文件夹中有这个字体或.TTF文件.
我试着用它作为:
Typeface typeFace_Rupee = Typeface.createFromAsset(getAssets(),fonts/Rupee_Foradian.ttf");
TextView tvRupee = (TextView) findViewById(R.id.textview_rupee_mlsaa);
tvRupee.setTypeface(typeFace_Rupee);
// Tried to set symbol on text view as follows.
tvRupee.setText("`");
Run Code Online (Sandbox Code Playgroud)
如上面的设置字体我得到空指针错误.
在选择字体并输入`之后的word文件中,我们得到了符号.但它不适用于android.
那么我应该遵循哪些步骤来做到这一点......
and*_*eek 184

嗨在字符串中使用它
印刷卢比符号:
<string name="Rs">\u20B9</string>
对于打印Rs文本:
<string name="rs">\u20A8</string>
San*_*ain 17
使用\u20B9,如果你想打印Rupee Symbol
和
使用\u20A8,如果你要打印"Rs"
Mur*_*san 10
试试这个,而不是Rupee_Foradian.ttf使用Rupee.ttf 它将起作用.我得到货币符号.
Typeface tf = Typeface.createFromAsset(getAssets(), "font/Rupee.ttf");
textView1.setTypeface(tf);
textView1.setText("`");
Run Code Online (Sandbox Code Playgroud)
小智 6
在适配器上使用
Viewholder.price.setText("Price: \u20B9"+dataAdapterOBJ.getPrice());
Run Code Online (Sandbox Code Playgroud)