gpt4 book ai didi

react-native - 如何删除博览会 BarCodeScanner 中的多余空白

转载 作者:行者123 更新时间:2023-12-01 04:40:02 25 4
gpt4 key购买 nike

iOS 工作正常 BarCodeScanner 全屏显示,但当我使用 android 时,会有额外的空白。

<BarCodeScanner
onBarCodeScanned={scanned ? undefined : this._handleBarCodeScanned}
style={[StyleSheet.absoluteFill, { flex: 1 }]}
/>

我也通过提供不同的风格进行检查,但没有运气
style={{
height: Dimensions.get('window').height,
width: Dimensions.get('window').width,
}}

White space example

最佳答案

这似乎是最近版本的 expo-barcode-scanner 中的一个问题。一种可能的解决方法是将 BarCodeScanner 的尺寸显式设置为屏幕尺寸:

import { Dimensions } from 'react-native';

<BarCodeScanner style={{
width: Dimensions.get('screen').width,
height: Dimensions.get('screen').height,
}} />

请注意,将其设置为窗口的尺寸,就像您尝试的那样,不起作用。

关于react-native - 如何删除博览会 BarCodeScanner 中的多余空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57071808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com