在文本视图设置印度卢比符号 [英] Set Indian Rupee symbol on text view

查看:175
本文介绍了在文本视图设置印度卢比符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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>  

这篇关于在文本视图设置印度卢比符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆