iOS 中的卢比符号
如何在 iPhone 上的 UILabel
中添加卢比符号?
How do I add a rupee symbol in a UILabel
on the iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 iPhone 上的 UILabel
中添加卢比符号?
How do I add a rupee symbol in a UILabel
on the iPhone?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
也许您必须找到某种具有类似符号的语言。
或者,您可以从某个地方复制卢比符号(例如从包含该符号的软拷贝文档中复制)并将其直接从那里粘贴到您的 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
前往
在 Xcode 7 中,符号位置与 Atul 建议的位置略有不同。
Go to
In Xcode 7, the symbols location has been changed a bit from what has been suggested by Atul.
浏览下面的帖子,
本地化 iPhone 货币
编辑:
您还可以采用将卢比符号作为
UIImageView
的方法,并在UILabel
视图之前或之后显示它。请参阅参考代码:
在
.h
文件中包含以下内容...并且您的 .m 文件如下所示。
并为所有三个视图设置适当的帧值,
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 aUILabel
view.Please see the reference code :
Have below in
.h
file...And your .m file would be like below.
And set the appropriate frame value for all three views,
这是我使用 Unicode 字符 完成此操作的方法,它正在工作并经过我测试。
NSString *rupee=@"\u20B9";
NSLog(@"打印卢比符号%@",卢比);
请参考此链接 Unicode 字符
对于 Swift 语言,您应该尝试!
// 对于 Swift >2.0
有关 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!
// for Swift >2.0
more about UniChar you should check this Official Apple Doc Cheers :)
卢比符号作为平台本身的一部分提供。转到编辑>特殊字符>货币符号。
当我第一次使用它时,我的印象是这是 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)
是的,Parth 是对的,只需将卢比符号 ($) 复制并粘贴到 NSString 即可。
Yups, Parth is right just copy and paste the rupee symbol (₹) to NSString and you are done.
在 Swift 4 中
let RSlabel = UILabel()
let cost = 1000
override func viewDidLoad() {
}
In Swift 4
let RSlabel = UILabel()
let cost = 1000
override func viewDidLoad() {
}