Fix iPhone X safe area insets to avoid jumps (#1728)
This commit is contained in:
parent
4db67a9734
commit
8673bc69c4
1 changed files with 5 additions and 1 deletions
|
|
@ -40,7 +40,10 @@ export default class SafeAreaIos extends PureComponent {
|
|||
this.state = {
|
||||
keyboard: false,
|
||||
safeAreaInsets: {
|
||||
top: 20, left: 0, bottom: 15, right: 0,
|
||||
top: this.isX ? 44 : 20,
|
||||
left: 0,
|
||||
bottom: this.isX ? 34 : 15,
|
||||
right: 0,
|
||||
},
|
||||
statusBarHeight: 20,
|
||||
};
|
||||
|
|
@ -87,6 +90,7 @@ export default class SafeAreaIos extends PureComponent {
|
|||
if (this.isX) {
|
||||
SafeArea.getSafeAreaInsetsForRootView().then((result) => {
|
||||
const {safeAreaInsets} = result;
|
||||
|
||||
if (this.mounted) {
|
||||
this.setState({safeAreaInsets});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue