【发布时间】:2017-07-17 21:14:07
【问题描述】:
我试图将导航栏中的右侧按钮向右移动,以使其与表格视图上的按钮对齐,这是目前的样子
我做了一个这样的按钮:
let allButton = UIButton(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
allButton.layer.borderColor = Constants.AppColor.cgColor
allButton.layer.borderWidth = 1
allButton.layer.backgroundColor = UIColor.white.cgColor
allButton.addTarget(self, action: #selector(selectAllContacts), for: .touchUpInside)
allButton.layer.cornerRadius = 10
我将它添加到我的导航栏,如下所示:
navigationItem.rightBarButtonItems = [UIBarButtonItem(customView: allButton), importButton]
我尝试添加图片插入、内容插入,但不起作用。
知道我还能尝试什么吗?
【问题讨论】:
标签: swift swift3 uinavigationcontroller navigationbar