3

I am working on application which supports both Portrait and Landscape mode. I am using default TabBarController in Storyboard.

NOTE: I am adding custom offset on images

In Portrait mode the image size of tabbarItems are looking well nice. But when i am rotating my device to landscape mode, the TabbarItems images are looking too small

How can I resolve this so that i can have the bigger size for landscape mode.

Here are the screenshots for both portrait and landscape mode.

Portrait Landscape

Any better approach for tab bar in landscape mode ?

Thanks!

#Edit 1 I added custom offset for landscape mode (all are having a negative value) and the size increased. but on tapping the size is increasing (on each tap)

#Edit 2 I removed left and right inset from landscape mode and the increasing image size is fixed but the size is again decreased.

Any Suggestion about what's happening ?

3 Answers3

0

Tried to add imageInsets

 var item0: UITabBarItem? = tabBarController.tabBar.items[0]
 item0?.imageInsets = UIEdgeInsetsMake(3, 0, -3, 0)
Aman Gupta
  • 159
  • 1
  • 8
0

I just ran into this, you need to set the tabbarItem's landscapeImagePhoneInsets property as well.

dave234
  • 4,793
  • 1
  • 14
  • 29
0

If you have set icons from storyboard try setting same image for landscape also.See the landscape property and set image like this

Mak13
  • 330
  • 3
  • 14