question one: adaptation
1. First a simple definition of Iponex
#define ISIPHONEX (screenheight = 812.0f)? Yes:no 2. A simple understanding of the Iphonex navigation bar status bar tabar height
1. Navigation bar height 88 non-Iponex mobile phone is 64
2. Status bar height 44 non Iponex mobile phone is 20
The 3.tabar height 83 Iphonex mobile phone is 49 as shown in the following figure;
3. Define its height
#define Heightnavcontentbar 44.0f
#define Heightstatusbar (isiphonex==yes)? 44.0f:20.0f
#define Heightnavbar (isiphonex==yes)? 88.0f:64.0f
#define Heighttabbar (isiphonex==yes)? 83.0f:49.0f
That's it. You've solved the problem of suitability, only for custom navigation bar question two: push when tabbar up and cause a small black screen
Briefly, this is a face bug for an Apple official developer, directly on the code below;
Add this method to your base class navigation controller's jump proxy method;
-(void) Pushviewcontroller: (Uiviewcontroller *) Viewcontroller animated: (BOOL) Animated {
[Super Pushviewcontroller:viewcontroller animated:animated];
Modify the Tabbra frame
CGRect frame = self.tabBarController.tabBar.frame;
FRAME.ORIGIN.Y = [UIScreen mainscreen].bounds.size.height-frame.size.height;
Self.tabBarController.tabBar.frame = frame;
problem Three: UIWebView loading the side black screen loaded to restore
The reason is unknown, directly on the code, in the initialization of WebView, this method can be set;
if (@available (IOS 11.0, *)) {
_webview.scrollview.contentinsetadjustmentbehavior = Uiscrollviewcontentinsetadjustmentnever;
}