TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Image in UITabBarItem

Forums > iOS

Why UITabBarItem on iPhone it shows the image above the text but on ipad it shows the image on the left? Is there a way that regardless of the device the image is always above the text?

Currently I have tried to use the UITabBarItemAppearance class. But, I have not had the expected results, in fact I do not notice any change.

Thanks.

3      

Upgrade.

Create a custom class UITabBar and call the traitCollection property.

override var traitCollection: UITraitCollection { return UITraitCollection(horizontalSizeClass: .compact) }~~

horizontalSizeClass can be: .regular, .compact ...

3      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.