xcode 如何在 UIBarButtonItem 中制作箭头,如 swift 中的后退按钮箭头
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32399330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make a arrow in UIBarButtonItem like back button arrow in swift
提问by Alexander Khitev
回答by baydi
U can use Attributed String and assign it to your UIButton Use this string
您可以使用属性字符串并将其分配给您的 UIButton 使用此字符串
var str = "< Playlist Table"
var str = "< Playlist Table"
Use this tutorial for further detail http://www.ioscreator.com/tutorials/attributed-strings-tutorial-ios8-swift
使用本教程了解更多详情http://www.ioscreator.com/tutorials/attributed-strings-tutorial-ios8-swift
It will Help.ThankYou
它会有所帮助。谢谢
回答by user44776
Custom Back Button
自定义后退按钮
For those of you are here to make a custom back button, check this similar SO answerwhich works perfectly.
回答by user5300943
If you have a navigation controller, this should appear automatically when you move from ViewController A to B.
如果你有一个导航控制器,当你从 ViewController A 移动到 B 时它应该会自动出现。
To change the text "Playlist Table" in controller B, you need to set it on controller A.
要更改控制器 B 中的文本“播放列表”,您需要在控制器 A 上进行设置。