ios - Remove tab bar item text, show only image -
simple question, how can remove tab bar item text , show image?
i want bar items in instagram app:
in inspector in xcode 6 remove title , take @2x (50px) , @3x (75px) image. image not utilize free space of removed text. ideas how accomplish same tab bar item image in instagram app?
you should play imageinsets
property of uitabbaritem
. here sample code:
let tabbaritem = uitabbaritem(title: nil, image: uiimage(named: "more") tabbaritem.imageinsets = uiedgeinsets(top: 9, left: 0, bottom: -9, right: 0)
values within uiedgeinsets
depend on image size. here result of code in app:
ios swift uitabbaritem
No comments:
Post a Comment