I'm trying to format two UIBarButtonItems so that they are right next to each other in the upper right corner. I have already tried changing the UI Edge Insets, but it didn't really move the icons around. Screenshot of current UI bar
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)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.