LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.04k stars 342 forks source link

UITabBar layout issues on IOS 13 and 14 #439

Closed law-cell closed 3 years ago

law-cell commented 3 years ago

Description

please watch this photo.

Simulator Screen Shot - iPhone 11 - 2021-04-13 at 01 11 23

It is normal in TabBarViewController

and I change the code from: bottomViewFrame.origin = CGPoint(x: bottomViewFrame.minX, y: view.bounds.height - bottomViewFrame.height) to: bottomViewFrame.origin = CGPoint(x: bottomViewFrame.minX, y: view.bounds.height - 150)

I can see that it is normal but in the different position. simulator_screenshot_44073A35-0E57-4278-80BD-4D0C2289D978

Device, OS and Xcode Versions I try it on several devices and different versions of IOS, which has no change.

law-cell commented 3 years ago
截屏2021-04-13 上午1 27 04

I add only a UITabBar in a UIViewController.

LeoNatan commented 3 years ago

I don't understand what you are doing. Are you using a UITabBarController or just a UITabBar in side a regular UIViewController?

You should be using UITabBarController, as that is the only one supported. If you want to use UITabBar directly, you need to implement a lot of things, such as https://github.com/LeoNatan/LNPopupController/blob/9cde3c060c9e66b52f4949b18b315876d6004420/LNPopupController/LNPopupController/UIViewController%2BLNPopupSupport.h#L272 and maintain this on your own. It won't be enough, as there is a lot of custom code to support UITabBarController.

LeoNatan commented 3 years ago

Clearly, the framework works when used properly. Run the example project and see if you see the issue there.

law-cell commented 3 years ago

@LeoNatan, thanks, I am using a UITabBar inside a regular UIViewController.

So, you mean I'd be better using a UITabBarController?

LeoNatan commented 3 years ago

Yes. It just does what you are trying to do, in a standard way.

law-cell commented 3 years ago

Thanks again!