#点击右上角的 star、watch 按钮,可以收藏本仓库,看到本仓库的更新!
饿了么 UED iPhone X设计适配指南 & iOS 11新特性
如果是那种自定义TabBar中间是按钮的这种操作,我试了一下,之前中间按钮的高度设置的是TabBar的高度( CGFloat buttonH = self.frame.size.height;),现在直接赋值,也可以解决这种问题 。CGFloat buttonH = 49;
ios 11 UITabBar UITabBarItem positioning issue
#define IS_IPHONEX (([[UIScreen mainScreen] bounds].size.height-812)?NO:YES)
self.tabBarController = [[UITabBarController alloc] init];
self.window.rootViewController = [[UIViewController alloc] init];
if(IS_IPHONEX)
self.window.rootViewController.view.frame = CGRectMake(self.window.rootViewController.view.frame.origin.x, self.window.rootViewController.view.frame.origin.y, self.window.rootViewController.view.frame.size.width, self.window.rootViewController.view.frame.size.height + 32);
[self.window.rootViewController.view addSubview:self.tabBarController.view];
self.tabBarController.tabBar.barTintColor = [UIColor colorWithWhite:0.98 alpha:1.0];
self.window.rootViewController.view.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0];
if ([platform isEqualToString:@"iPhone10,1"]) return @"iPhone 8";
if ([platform isEqualToString:@"iPhone10,4"]) return @"iPhone 8";
if ([platform isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus";
if ([platform isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";
if ([platform isEqualToString:@"iPhone10,3"]) return @"iPhone X";
if ([platform isEqualToString:@"iPhone10,6"]) return @"iPhone X";