How big should a UIBarButtonItem image be?

Epsilon Prime picture Epsilon Prime · Oct 19, 2009 · Viewed 80.1k times · Source

I'm looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button.

How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn't list anything about the size the image should be.

Answer

Sixten Otto picture Sixten Otto · Oct 19, 2009

As of iOS 11, the Human Interface Guidelines suggest glyphs be about 25×25 points in toolbars and navigation bars, up to a maximum of about 28 points. (And the HIG should definitely be in your bookmarks if you're working on iOS apps!)

That would translate to images 25px square for older devices like iPad 2 / Mini, 50px square for most current devices like iPhone 8 or iPad, and 75px square for Retina HD devices (the iPhone 6/7/8 Plus, or iPhone X). Asset catalogs will help immensely in keeping the different asset sizes organized (and Xcode can even generate them from vector sources these days).