-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
for full screen image rendering the library use
const windowDimensions = useWindowDimensions();
const dimensions = containerDimensions || windowDimensions;The issue is that useWindowDimensions returns the heigh without the height of the android navigation bar, which means that the image will never render in real fullscreen, but keep a black margin under of the exact size of the navigation bar.
For real fullscreen mode, a workaround is to use this instead:
import {Dimensions as RNDimensions} from 'react-native'
// ...
const windowDimensions = useWindowDimensions()
const [dimensionsToUse, setDimensionsToUse] = useState(
RNDimensions.get('screen')
)
useEffect(() => {
// set the actual screen heigh and not the window height
setDimensionsToUse(RNDimensions.get('screen'))
},
// re calculate when device orientation change
[windowDimensions.height, windowDimensions.width])
const dimensions = containerDimensions || dimensionsToUse //containerDimensions || windowDimensionsMetadata
Metadata
Assignees
Labels
No labels