【发布时间】:2019-08-10 06:32:16
【问题描述】:
我需要在图片上方显示文字和图标。但是这里的图像视图和文本和加载图标不需要链接。两者都需要有一个单独的视图。
我设置了两个视图(一个视图用于图像,另一个用于并在我的视图中添加 marginTop:-300 值。这是一种错误的行为。
<View style={{ aspectRatio: 4 / 5, alignSelf: 'center', width: '100%', paddingLeft: '5%', paddingRight: '5%', opacity: 0.4,}}>
<FastImage resizeMode={FastImage.resizeMode.cover} style={{width: '100%',height: '100%',marginTop:18}} source={["imageUrl"]}/>
</View>
<View style={{flex:1, alignSelf: 'center', alignItems: 'center', justifyContent: 'center', marginTop:-50}}>
<ActivityIndicator size={"large"} color={"#ffffff"} style ={{marginTop:-700,}}/>
<Text style={{ fontSize: 15, fontFamily: "OpenSans-Semibold",marginTop:-300,color:'white'}}>Image captured</Text>
</View>
【问题讨论】:
-
你尝试了什么?
-
我在上面添加了我的代码 sn-p。请重新加载并检查。我需要在图像上方显示不透明度。所以我用了这个。
标签: react-native react-native-image