iOS:在 UIBarButtonItem 和 Button 中附加带有标题的 FontAwesome 图标
问题描述
我想要在我的 NavigationBar 中使用这样的 UIBarButton 项,并且
I want a UIBarButton Item like this in my NavigationBar and
像这样的普通 UIButton
Normal UIButton like this
我已经尝试过使用这些链接问题1 问题 2 问题 3 但没有得到输出.
I already tried using these links Question 1 Question 2 Question 3 but didn't got the output.
我需要将那个 FontAwesome 图标附加到按钮标题文本中.
My need is to append that FontAwesome icon with the button title text.
有人可以帮忙吗?
我的代码是:
推荐答案
如果FontAwesome
图标的code是""
,则设置text为@"U0000f007"
改成标题.
If code of FontAwesome
Icon is ""
, then set text to @"U0000f007"
into Title.
UIButton 使用以下代码:-
UIBarButton 使用以下代码:-
如果您想在字符串中附加图标,请使用以下代码:-
If you want to append your string with icon then use following code:-
希望,这就是您要找的.任何问题都可以回复我.:)
Hope, this is what you're looking for. Any concern get back to me. :)
这篇关于iOS:在 UIBarButtonItem 和 Button 中附加带有标题的 FontAwesome 图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!