美文网首页
让UIBarButtonItem的image显示自身颜色,而不是

让UIBarButtonItem的image显示自身颜色,而不是

作者: 苏格拉木有底oo | 来源:发表于2016-02-24 18:19 被阅读972次
    let image = UIImage(named: "设置icon")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
    self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: UIBarButtonItemStyle.Plain, target: self, action: "jumpToSetting")
    

    更新Swift3

    let image = UIImage(named:"设置icon")?.withRenderingMode(.alwaysOriginal)
    

    相关文章

      网友评论

          本文标题:让UIBarButtonItem的image显示自身颜色,而不是

          本文链接:https://www.haomeiwen.com/subject/hwjikttx.html