美文网首页
Swift--自定义leftBarButtonItem显示不出来

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