0

In UITabBarController, I am placing the tab bar on top of the screen using below code :

self.tabBar.frame = CGRectMake(0,0,UIScreen.mainScreen().bounds.width,50)

This works perfectly on iOS 10. But when the same app is installed on iOS11. It placing at the bottom only and not moving up.

Realy dont know what has changed in iOS11
But
How to move tabbar up for iOS 11

Sujay U N
  • 4,974
  • 11
  • 52
  • 88
  • Yes, you are right. I have applied many patches for change position of TabBar But none of the patches working. I think we will go to customise TabBar. Happy Coding! :) – Renish Dadhaniya Nov 17 '17 at 04:15

1 Answers1

2

After so much struggle figured out the solution.

I was placing the tabBar.frame code inside viewDidAppear which works for iOS 10 and below but to support for iOS 11, need to place inside viewDidLayoutSubviews as shown below which is actually the correct method :

override func viewDidLayoutSubviews()
{
    tabBar.frame = CGRectMake(0,0,UIScreen.mainScreen().bounds.width,50)
}
Sujay U N
  • 4,974
  • 11
  • 52
  • 88