【问题标题】:How can I use and display the same image shown as Launch Image for an iOS app in React Native?如何在 React Native 中为 iOS 应用程序使用和显示与 Launch Image 相同的图像?
【发布时间】:2017-07-06 15:34:50
【问题描述】:

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

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

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

【问题讨论】:

    标签: ios react-native launchimage


    【解决方案1】:

    让图像在 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%', }, } }

    【讨论】:

    • 这不是我需要的,伙计:D 我的应用程序已经准备好了,我已经从头开始创建了整个应用程序。我唯一无法做到的是获取要显示的正确图像,与 Launch Image 相同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-06
    • 1970-01-01
    • 2018-09-24
    相关资源
    最近更新 更多