Reactjs 在iOS上的React Native中,如何在ImageBackground上的父视图中显示文本元素?

Reactjs 在iOS上的React Native中,如何在ImageBackground上的父视图中显示文本元素?,reactjs,react-native,expo,Reactjs,React Native,Expo,我在react native中有一个包含背景图像的屏幕,我想将文本放在背景图像的顶部,但文本将不可见,因此我用视图组件包装文本组件。如何在iOs上渲染文本 我正在使用expo cli运行react native,react native是sdk-32。文本在android上呈现良好。当我移除视图组件时,文本在iOs上呈现良好 <ImageBackground source={require('../assets/launch3.jpg')} style={{ height: '100%',

我在react native中有一个包含背景图像的屏幕,我想将文本放在背景图像的顶部,但文本将不可见,因此我用视图组件包装文本组件。如何在iOs上渲染文本

我正在使用expo cli运行react native,react native是sdk-32。文本在android上呈现良好。当我移除视图组件时,文本在iOs上呈现良好

<ImageBackground source={require('../assets/launch3.jpg')} style={{ height: '100%', paddingLeft: '6%', paddingRight: '6%' }}>
<View style={{ width: '100%', height: '15%', backgroundColor: 'rgba(255, 255, 255, 0.4)', borderRadius: 5, marginTop: '90%' }}>
<Text style={{ width: '90%', alignSelf: 'center', textAlign: 'center', fontSize: 18, color: '#005F6A', marginTop: '5%' }}>
"Text to display"
</Text>
</View>
</ImageBackground>

“要显示的文本”

我希望文本“text to display”在iOs上呈现,但只呈现环绕它的视图。

在包含文本标记的视图标记中将位置属性设置为绝对

<ImageBackground source={require('../assets/launch3.jpg')} style={{ height: '100%', paddingLeft: '6%', paddingRight: '6%' }}>
<View style={{ position: 'absolute', width: '100%', height: '15%', backgroundColor: 'rgba(255, 255, 255, 0.4)', borderRadius: 5, marginTop: '90%' }}>
<Text style={{ width: '90%', alignSelf: 'center', textAlign: 'center', fontSize: 18, color: '#005F6A', marginTop: '5%' }}>
"Text to display"
</Text>
</View>
</ImageBackground>

“要显示的文本”

在包含文本标记的视图标记中将位置属性设置为绝对

<ImageBackground source={require('../assets/launch3.jpg')} style={{ height: '100%', paddingLeft: '6%', paddingRight: '6%' }}>
<View style={{ position: 'absolute', width: '100%', height: '15%', backgroundColor: 'rgba(255, 255, 255, 0.4)', borderRadius: 5, marginTop: '90%' }}>
<Text style={{ width: '90%', alignSelf: 'center', textAlign: 'center', fontSize: 18, color: '#005F6A', marginTop: '5%' }}>
"Text to display"
</Text>
</View>
</ImageBackground>

“要显示的文本”