我尝试在我的导航栏移至右边的按钮可以用按钮对齐在表视图右边这里是目前看起来像我怎么能在UINavigation酒吧将按钮移到右边
我犯了这样的一个按钮:
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
和IM将它添加到我的导航栏是这样的:
navigationItem.rightBarButtonItems = [UIBarButtonItem(customView: allButton), importButton]
我已经尝试添加图像的插图,内容的镶边, nd它不起作用。
任何想法我还可以尝试什么?
我不认为这会解决我的问题,我只需要将我的按钮向右移动几个像素 – RickS