fix: Fixes UI layout regression on earlier Android versions (#2970)
This commit is contained in:
committed by
GitHub
parent
ce1fbe4ea4
commit
cb85b32e14
@@ -48,6 +48,8 @@ const MobileWebAppContents = ({ destroyAndReload }: { destroyAndReload: () => vo
|
|||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
|
|
||||||
const screenHeight = Dimensions.get('screen').height
|
const screenHeight = Dimensions.get('screen').height
|
||||||
|
const androidVersion = Platform.OS === 'android' ? Platform.Version : 0
|
||||||
|
const useFlexLayout = Platform.OS === 'ios' || androidVersion < 34
|
||||||
const [webViewContainerHeight, setWebViewContainerHeight] = useState(screenHeight)
|
const [webViewContainerHeight, setWebViewContainerHeight] = useState(screenHeight)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -427,16 +429,16 @@ const MobileWebAppContents = ({ destroyAndReload }: { destroyAndReload: () => vo
|
|||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={
|
style={
|
||||||
Platform.OS === 'android'
|
useFlexLayout
|
||||||
? {
|
? {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: '#000000',
|
||||||
|
}
|
||||||
|
: {
|
||||||
height: webViewContainerHeight,
|
height: webViewContainerHeight,
|
||||||
backgroundColor: '#000000',
|
backgroundColor: '#000000',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
}
|
}
|
||||||
: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: '#000000',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<WebView
|
<WebView
|
||||||
|
|||||||
Reference in New Issue
Block a user