0
iQi - 面白いアプリを開発中
var leftNegativeSpacer: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
leftNegativeSpacer.width = -16.0
self.navigationItem.leftBarButtonItems = [leftNegativeSpacer, leftBarButton]
var rightNegativeSpacer: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
rightNegativeSpacer.width = -6.0
self.navigationItem.rightBarButtonItems = [rightNegativeSpacer, rightBarButton]
0
Lubo - PHP言語が得意です
var leftNavButton = UIButton(frame: CGRectMake(0, 0, 50, 42));
leftNavButton.addTarget(self, action: "searchButtonTapped:", forControlEvents: UIControlEvents.TouchUpInside)
leftNavButton.setImage(UIImage(named: "title_btn_search"), forState: UIControlState.Normal)
var leftBarButtonItem = UIBarButtonItem(customView: leftNavButton)
var negativeSpacer: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
negativeSpacer.width = -16.0
self.navigationItem.leftBarButtonItems = [negativeSpacer, leftBarButtonItem]
var rightNavButton = UIButton(frame: CGRectMake(0, 0, 50, 42))
rightNavButton.addTarget(self, action: "createNewButtonTapped:", forControlEvents: UIControlEvents.TouchUpInside)
rightNavButton.setImage(UIImage(named: "title_btn_new"), forState: UIControlState.Normal)
var rightBarButtonItem = UIBarButtonItem(customView: rightNavButton)
var rightSpacer: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
rightSpacer.width = -16.0
self.navigationItem.rightBarButtonItems = [rightSpacer, rightBarButtonItem]