Swift--自定义leftBarButtonItem显示不出来
作者:
乐逍遥的笔记 | 来源:发表于
2019-01-17 11:28 被阅读14次在iOS10版本上,自定义的leftBarButtonItem显示不出来,在iOS11版本上可以显示出来。原因是我在iOS10版本上没有设置自定义button的frame大小,设置一下,就可以了,iOS11上面可以不用设置。
//床位列表
let bedListBtn = RYQButton.initTextButton(title: "床位列表", action: #selector(bedListClick), target: self, font: 30, style: .system, backColor: .clear)
// bedListBtn.frame = CGRect.init(x: 39*m6Scale, y: 30*m6Scale, width: 140*m6Scale, height: 50*m6Scale)
bedListBtn.setTitleColor(ButtonBackColor, for: UIControlState.normal)
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(customView: bedListBtn)
本文标题:Swift--自定义leftBarButtonItem显示不出来
本文链接:https://www.haomeiwen.com/subject/vjabdqtx.html
网友评论