如何在React Native中使用和显示与iOS应用程序的启动图像相同的图像?

时间:2017-07-06 15:34:50

标签: ios react-native launchimage

我想使用与应用程序启动时出现的完全相同的图像,在我的第一个场景中显示它并将活动指示器放在上面。

我在./ios/<app name>/Images.xcassets/LaunchImage.launchimage看到有用于启动的所有图像,并且有一个JSON文件包含有关使用哪个图像文件的信息,但我怎么知道哪个是我的情况(方向,装置)?

有什么建议吗?非常感谢,我正在使用React Native。

1 个答案:

答案 0 :(得分:0)

让图像成为render()中的父级:

render() { return ( <Image source={require('./yourImagepath/image.png')} style= {styles.backgroundImage}> <View> .... </View> </Image> ); const styles = StyleSheet.create({ backgroundImage: { flex: 1, width: '100%', height: '100%', }, } }