lundi 29 juin 2015

How to put a Bar button item to the bottom of a toolbar?

I have a toolbar at the top of my app. I changed the height programmatically to make it a bit bigger.

    var constH = NSLayoutConstraint(item: toolbar, attribute: NSLayoutAttribute.Height,
    relatedBy: NSLayoutRelation.Equal, toItem: nil, 
    attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 64)
    toolbar.addConstraint(constH)

But now I have the problem when I add bar button items via storyboard, it automatically centers them vertically. Only the standard items stay at the bottom. How to solve?

[Please answer in Swift]

enter image description here

Aucun commentaire:

Enregistrer un commentaire