某些设备中的启动画面失真 [英] Distorted splash screen in some devices

查看:34
本文介绍了某些设备中的启动画面失真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在修复 Android 上的启动画面失真问题时遇到了问题.我正在使用 React Native.请注意,这仅发生在某些设备上,例如,我有一个 android 版本为 4.2.2 的三星(启动画面未失真),而具有 8+ android 版本的三星的启动画面失真.

以下是附加的扭曲和未扭曲的启动画面:

第一张图片是NOT DISTORTED"显示

第二张图片是失真"显示

这是指南的链接

解决方案

按照步骤:

1) 仅使用图标并将背景设置为渐变可绘制.

2) 白色图标的宽度和高度应该相等.使用 Icon 并放置在 XHDPI 和 XXHDPI drawable 文件夹中.

布局设计:

<图像视图android:layout_width="90dp"android:layout_height="90dp"android:background="@android:color/white"机器人:layout_centerHorizo​​ntal="true"android:layout_marginTop="90dp"/></RelativeLayout>

可绘制背景示例.xml:

 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" ><梯度android:startColor="#00ff00"android:endColor="#99ff99"android:angle="90"/><角落android:radius="0dp"/></形状>

具有多屏幕支持的示例输出:

I'm having trouble fixing the distorted splash screen issue on android. I'm using React native. Note that this only happens to some devices, for example, I have a samsung with android version 4.2.2 (splash screen NOT distorted), while the samsung which has an android version of 8+ is having a distorted splash screen.

Below is the attached distorted and not distorted splash screens:

First image is the "NOT DISTORTED" display

Second image is the "DISTORTED" display

This is the link for the guideline Splash Screen Guide

解决方案

Follow steps :

1) Use only Icon and set Background as gradient drawable.

2) White Icon's width and height should be equal. Use Icon and place in XHDPI and XXHDPI drawable folder.

Layout Dsign :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/sample">

  <ImageView
    android:layout_width="90dp"
    android:layout_height="90dp"
    android:background="@android:color/white"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="90dp"/>
</RelativeLayout>

Drawable background sample.xml :

 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
   <gradient
    android:startColor="#00ff00"
    android:endColor="#99ff99"
    android:angle="90"/>
   <corners
    android:radius="0dp"/>
 </shape>

Sample output which has multiple screen support:

这篇关于某些设备中的启动画面失真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆