![](/img/trans.png)
[英]How to disable/enable a UIPanGestureRecognizer with two separate UIBarButtonItems?
[英]How to format two UIBarButtonItems next to each other on the right?
我正在嘗試格式化兩個 UIBarButtonItem,使它們在右上角彼此相鄰。 我已經嘗試過更改 UI 邊緣插圖,但它並沒有真正移動圖標。 當前 UI 欄的屏幕截圖
lazy var profileButton = UIBarButtonItem(
image: UIImage(named: "account"),
style: .plain,
target: self,
action: #selector(displayAccountViewController(sender:))
)
lazy var followFriendsButton = UIBarButtonItem(
image: UIImage(named: "follow"),
style: .plain,
target: self,
action: #selector(displayFollowFriendsViewController(sender:))
)
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = "Review Feed"
tableView.register(ReviewFeedCell.self, forCellReuseIdentifier: cellReuseIdentifier)
tableView.separatorStyle = .none
navigationItem.rightBarButtonItems = [profileButton, followFriendsButton]
NotificationCenter.default.addObserver(self, selector: #selector(loadData), name: ShowCollector.updateNotification, object: nil)
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.