wangrui460 / WRNavigationBar_swift

WRNavigationBar which allows you to change NavigationBar's appearance dynamically

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

屏幕高度是896的Max和XR导航栏问题。修改isiPhone X 即可。

Wolfgang89 opened this issue · comments

见代码。 2个地方都要修改。
class func isIphoneX() -> Bool {
// return UIScreen.main.bounds.equalTo(CGRect(x: 0, y: 0, width: 375, height: 812))
if (UIScreen.main.bounds.height >= 812) { return true}
else{return false}
}

加上 UIDevice.current.userInterfaceIdiom == .phone
平板才會正常顯示
if (UIScreen.main.bounds.height >= 812 && UIDevice.current.userInterfaceIdiom == .phone) { return true}
else{return false}
}

class func isIphoneX() -> Bool {
return UIScreen.main.bounds.equalTo(CGRect(x: 0, y: 0, width: 375, height: 812)) ||
UIScreen.main.bounds.equalTo(CGRect(x: 0, y: 0, width: 812, height: 375)) ||
UIScreen.main.bounds.equalTo(CGRect(x: 0, y: 0, width: 414, height: 896)) ||
UIScreen.main.bounds.equalTo(CGRect(x: 0, y: 0, width: 896, height: 414))
}