android - 如何在 react-native-splash-screen 的 android 初始屏幕中设置响应式徽标?
问题描述
我正在尝试使 android 初始屏幕中的徽标在不同的 android 设备上正确缩放。
我按照 npm react-native-splash-screen的说明进行操作。
初始屏幕徽标在 iOS 上可以很好地缩放,但在 Android 上它会延伸到屏幕之外,如下图所示。
launch_screen.xml
在布局文件夹中:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/launch_screen"
android:scaleType="centerCrop" />
</RelativeLayout>
安卓过滤器:
项目筛选:
解决方案
你是在本地做的
虽然我已经用 react native 方式做到了
import React, { PureComponent } from "react";
import { Image, View } from "react-native";
import { Images, Metrics } from "@common";
import { Navigator } from "@services";
import styles from "./styles";
import SplashScreenComponent from "react-native-splash-screen";
const minDisplayTime = 1000;
class SplashScreen extends PureComponent {
componentDidMount() {
SplashScreenComponent.hide();
setTimeout(() => Navigator.navigate("AuthLoading"), 5000);
}
render() {
return (
<View style={styles.container}>
<Image
source={Images.splashGif}
style={{ width: '90%', borderWidth: 1, borderColor: '#fff' }}
resizeMode={"contain"}
/>
</View>
);
}
}
export default SplashScreen;
推荐阅读
- laravel - 不要验证是否没有编辑 - Laravel 7
- python - 如何使用python剪切一列并将其粘贴到excel中?
- sql - 使用解析函数查询同类产品
- javascript - 当所选行是最后一行但表在 div 内时自动滚动表
- haskell - 在 Haskell 中使用非分数复数
- c++ - winsock2 不支持原始套接字侦听
- reactjs - 在 React Hook 中获取默认值?
- git - 如何用 shell 显示 git 忽略的文件?
- python - python中的网络抓取返回“无”
- flutter - Flutter:如何处理 Flutter 与 API + MongoDB 的命名约定不同以及名称不匹配的问题?