react-native - 在 react-native-bootsplash 中调整初始屏幕图像的大小
问题描述
我正在开发一个 react native 项目,我使用 react-native-bootsplash 作为我的启动画面。问题是启动画面上的标志图像太小,因为启动画面标志的推荐尺寸为100。有没有办法调整图像大小或使用bootsplash生成的@5x图像?
解决方案
我在 react-native-bootsplash 的文档(https://www.npmjs.com/package/react-native-bootsplash)上找到了这个:
该react-native generate-bootsplash <logoPath>
命令有几个参数:
Options:
--background-color <color> color used as launch screen background (in hexadecimal format) (default: "#fff")
--logo-width <width> logo width at @1x (in dp - we recommand approximately ~100) (default: 100)
--assets-path [path] path to your static assets directory (useful to require the logo file in JS)
--flavor <flavor> [android only] flavor build variant (outputs in an android resource directory other than "main")
-h, --help output usage information
所以如果你想创建一个大于默认大小 100 的 bootsplash,你可以这样做:
yarn react-native generate-bootsplash assets/bootsplash_logo_original.png \
--background-color=F5FCFF \
--logo-width=300 \
--assets-path=assets \
--flavor=main
我只想确保您的徽标具有足够高的质量,以便您的 bootsplash 仍然看起来不错。
推荐阅读
- java - 如何在运行时在 android 应用程序中隐藏(或删除)操作栏
- javascript - 如何获得分层 xstate 机的初始状态?
- javascript - 打印 HTML 文档的特定部分
- azure - Microsoft Graph“创建”订阅不适用于应用程序令牌
- javascript - 无法读取未定义 React JS 的属性“concat”
- runtime - Theta 表示法的运行时间
- oracle - Oracle 将多行上的两个参数提供给子查询(或从一个查询到另一个)
- sql - 使用 VBA 和 SQL 在 Access 中更新表以进行预测过程
- python - 如何退出和关闭python程序
- c - 堆栈内存消耗是如何计算的?