当前位置:  开发笔记 > IOS > 正文

如何在UIBarButtonItem上使用info按钮

如何解决《如何在UIBarButtonItem上使用info按钮》经验,为你挑选了1个好方法。

如何使用信息灯UIBarButtonItem

我不想使用自定义图像,因为结果不是很好.
我想使用Apple"信息"按钮.
我正在使用Swift.

谢谢.



1> mokagio..:

没有直接的方法来使用UIBarButtonItemAPI创建这样的条形按钮.

您可以使用虽然配置了一个自定义视图.InfoLight UIButton,如建议在这里:

// Create the info button
let infoButton = UIButton(type: .infoLight)

// You will need to configure the target action for the button itself, not the bar button itemr
infoButton.addTarget(self, action: #selector(getInfoAction), for: .touchUpInside)

// Create a bar button item using the info button as its custom view
let infoBarButtonItem = UIBarButtonItem(customView: infoButton)

// Use it as required
navigationItem.rightBarButtonItem = infoBarButtonItem

如果您需要更多帮助,请随时发表评论.

推荐阅读
虎仔球妈_459
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有