Я создал navigation bar http://oi61.tinypic.com/r0p8w4.jpg с элементом левой кнопки, добавленным из раскадровки, titleView и тремя кнопками правой кнопки мыши из кода.Навигационная панель правая кнопка бара позиции позиций
Вот код:
override func viewDidLoad() {
super.viewDidLoad()
var screenWidth = UIScreen.mainScreen().bounds.width
// custom title view
var navBarWidth: CGFloat = self.navigationController!.navigationBar.frame.size.width
let customTitleView = UIView(frame: CGRectMake(0, 0, navBarWidth, 44))
titleLabel = UILabel(frame: CGRectMake(20, 0, navBarWidth, 40))
titleLabel.text = conversationName
if let titleFont = UIFont(name: "Roboto-Regular", size: 20) {
titleLabel.font = titleFont
}
titleLabel.textColor = UIColor.whiteColor()
customTitleView.addSubview(titleLabel)
self.navigationItem.titleView = customTitleView
// right bar buttons
var searchImage = UIImage(named: "search")!
var clipImage = UIImage(named: "clip")!
var pencilImage = UIImage(named: "pencil")!
var searchBtn = UIBarButtonItem(image: searchImage, style: UIBarButtonItemStyle.Plain, target: self, action: Selector("searchBtnPressed"))
searchBtn.tintColor = UIColor.whiteColor()
var clipBtn = UIBarButtonItem(image: clipImage, style: UIBarButtonItemStyle.Plain, target: self, action: Selector("clipBtnPressed"))
clipBtn.tintColor = UIColor.whiteColor()
var pencilBtn = UIBarButtonItem(image: pencilImage, style: UIBarButtonItemStyle.Plain, target: self, action: Selector("pencilBtnPressed"))
pencilBtn.tintColor = UIColor.whiteColor()
self.navigationItem.setRightBarButtonItems([pencilBtn, clipBtn, searchBtn], animated: false)
}
Моя проблема заключается в том, что я хочу, чтобы изменить интервал между правой кнопками, но я не знаю, как.
Я попытался добавить fixedbutton между ними, но он просто увеличил существующее пространство.
Может кто-нибудь мне помочь? Благодарю.
панель навигации пренебрегает интервал .use UIBarButton containerView инициализаторе – Mousavian
Используя * Roboto шрифт * на * IOS *? Ересь! ; D –
@ RicardoSánchez-Sáez было указано в PRD. – mikle94