如何使用信息灯UIBarButtonItem
?
我不想使用自定义图像,因为结果不是很好.
我想使用Apple"信息"按钮.
我正在使用Swift.
谢谢.
没有直接的方法来使用UIBarButtonItem
API创建这样的条形按钮.
您可以使用虽然配置了一个自定义视图.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
如果您需要更多帮助,请随时发表评论.