Open JonsonHI opened 2 years ago
Complementary to this, I would add a condition for Dynamic Island height. So, this should be the needs.
/index.js
|| (dimen.height === 852 || dimen.width === 852)
|| (dimen.height === 932 || dimen.width === 932)
export function getStatusBarHeight(safe) {
const deviceModel = DeviceInfo.getModel();
const isIphone14Pro = ['iPhone 14 Pro','iPhone 14 Pro Max'].includes(deviceModel);
return Platform.select({
ios: ifIphoneX(safe || isIphone14Pro ? 44 : 30, 20),
android: StatusBar.currentHeight,
default: 0
});
}
of course, we need react-native-device-info
and patch-package
/index.js || (dimen.height === 852 || dimen.width === 852) || (dimen.height === 932 || dimen.width === 932)