ios - How to put a Bar button item to the bottom of a toolbar? -
i have toolbar @ top of app. changed height programmatically make 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 have problem when add bar button items via storyboard, automatically centers them vertically. standard items stay @ bottom. how solve?
[please answer in swift]
you should hook bar button items using iboutlets, can add spacing using edge insets:
barbutton.imageinsets = uiedgeinsetsmake(0,10,0,0)
Comments
Post a Comment