在文本视图设置印度卢比符号印度、视图、符号、文本

2023-09-04 09:20:06 作者:你够资格吗@

我开发的应用程序。我需要设置在其上设置的文本量文本视图印度卢比的象征。

I am developing an application. And i need to set the symbol of Indian rupee on text view which is set with the text as amount.

符号:

我有这样的资产/ fonts文件夹字体或.TTF文件。

I am having the font or .TTF file of this in Assets/fonts folder.

和我试图使用它作为:

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("`");

如上设置字体,我得到空指针错误。

As above setting font i got null pointer error.

在Word文件,选择字体和输入`后我们得到了象征。但它是不工作的机器人。

In word file after choosing font and typing ` we got the symbol. but it is not working in android.

所以,我应该遵循什么步骤来做到这一点...

So what steps should i follow to do this...

推荐答案

喜字符串中使用

<string name="Rs">\u20B9</string> 

 (or)

 <string name="rs">\u20A8</string>