iOS 中的卢比符号

发布于 2024-10-26 21:41:39 字数 50 浏览 2 评论 0原文

如何在 iPhone 上的 UILabel 中添加卢比符号?

How do I add a rupee symbol in a UILabel on the iPhone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

黒涩兲箜 2024-11-02 21:41:40

也许您必须找到某种具有类似符号的语言。

或者,您可以从某个地方复制卢比符号(例如从包含该符号的软拷贝文档中复制)并将其直接从那里粘贴到您的 UILabel 文本中。

目前我不知道除此之外的任何其他方式,因为目前的键盘还没有卢比符号。将来可能会这样:)

希望这对您有帮助

May be you will have to find some language which has a similar symbol.

Or you can just copy the Rupee symbol from somewhere (like from some soft-copy document which contains that) and paste it directly from there into your UILabel text.

As for now I don't know any other way apart from this as present keyboards dont have a Rupee symbol as yet. May be in future it would be having that :)

Hope this helps you

笑咖 2024-11-02 21:41:40

前往

编辑->表情符号和符号

在 Xcode 7 中,符号位置与 Atul 建议的位置略有不同。

Go to

Edit -> Emoji & Symbols

In Xcode 7, the symbols location has been changed a bit from what has been suggested by Atul.

疏忽 2024-11-02 21:41:40

浏览下面的帖子,

本地化 iPhone 货币

编辑:

您还可以采用将卢比符号作为 UIImageView 的方法,并在 UILabel 视图之前或之后显示它。

请参阅参考代码:

.h 文件中包含以下内容...

UIView* iContainerView;
UIImageView* iRupeeSymbol;
UILabel* iAmountLabel;

并且您的 .m 文件如下所示。

iRupeeSymbol= [[UIImageView alloc] initWithImage:myRupeeImage];
iAmountLabel.text = @"55555";

[iContainetView  addSubview:iRupeeSymbol];
[iContainetView  addSubview:iAmountLabel];

[self.view addSubview:iContainetView];

并为所有三个视图设置适当的帧值,

Go through the below SO post,

Localize Currency for iPhone

Edited:

you could also go with the approach of having rupee symbol as an UIImageView and show it before OR after a UILabel view.

Please see the reference code :

Have below in .h file...

UIView* iContainerView;
UIImageView* iRupeeSymbol;
UILabel* iAmountLabel;

And your .m file would be like below.

iRupeeSymbol= [[UIImageView alloc] initWithImage:myRupeeImage];
iAmountLabel.text = @"55555";

[iContainetView  addSubview:iRupeeSymbol];
[iContainetView  addSubview:iAmountLabel];

[self.view addSubview:iContainetView];

And set the appropriate frame value for all three views,

ι不睡觉的鱼゛ 2024-11-02 21:41:39

这是我使用 Unicode 字符 完成此操作的方法,它正在工作并经过我测试。

NSString *rupee=@"\u20B9";
NSLog(@"打印卢比符号%@",卢比);

请参考此链接 Unicode 字符

对于 Swift 语言,您应该尝试!

let rupee = "\u{20B9}"
println(rupee)

// 对于 Swift >2.0

let rupee = "\u{20B9}"
print(rupee)

有关 UniChar 的更多信息,您应该检查此 官方 Apple 文档 干杯:)

Here is How I've done this by using Unicode Character It's working and tested by me.

NSString *rupee=@"\u20B9";
NSLog(@"print rupee symbol %@",rupee);

Please refer this link UniCode Character

For Swift Language you should try!

let rupee = "\u{20B9}"
println(rupee)

// for Swift >2.0

let rupee = "\u{20B9}"
print(rupee)

more about UniChar you should check this Official Apple Doc Cheers :)

烟酉 2024-11-02 21:41:39

卢比符号作为平台本身的一部分提供。转到编辑>特殊字符>货币符号。

当我第一次使用它时,我的印象是这是 Xcode 菜单选项的一部分,但现在当我在 Firefox 中打开的页面上输入内容并进入“编辑”菜单时,我看到了相同的特殊字符选项在菜单中,所以它可能是 OSX 本身的一部分。只需将其拖放到情节提要上您希望该符号出现的任何位置即可。我只是将其拖放到这里,让我们看看它是否出现在这里!

$

osx 中特殊字符的集成非常方便,并且该特殊字符也有许多变体(在本例中为卢比符号)

Rupee symbol is available as part of the platform itself. Go to Edit > Special Characters > Currency Symbols.

When I used it first, I was under the impression that this is part of the menu options of Xcode, but right now while I am typing here on this page opened in Firefox and I go to Edit menu, I see the same Special characters option in the menu so probably it is part of OSX itself. Just drag and drop it anywhere on the storyboard where you want this symbol to appear. I'm just dragging and dropping the same here, let's see whether it appears here or not!

This integration of special characters in osx is pretty handy and also has many variations for that special character (rupee symbol in this case)

幽梦紫曦~ 2024-11-02 21:41:39

是的,Parth 是对的,只需将卢比符号 ($) 复制并粘贴到 NSString 即可。

Yups, Parth is right just copy and paste the rupee symbol (₹) to NSString and you are done.

佼人 2024-11-02 21:41:39

在 Swift 4 中

let RSlabel = UILabel()

let cost = 1000

override func viewDidLoad() {

super.viewDidLoad()

RSlabel.text = "\u{20B9}"+"\(cost)"

print(RSlabel,"RSlabel")

}

In Swift 4

let RSlabel = UILabel()

let cost = 1000

override func viewDidLoad() {

super.viewDidLoad()

RSlabel.text = "\u{20B9}"+"\(cost)"

print(RSlabel,"RSlabel")

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文