0

美好的一天。最近我注意到活动负载之间存在可怕的延迟,其背景上附有图像。

基本上这是我的简单布局。

    <?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_vip"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ink.va.activities.VIPActivity">

    <ImageView
        android:id="@+id/rootImageView"
        android:src="@drawable/vip_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY" />
</RelativeLayout>

同时问题是我很困惑,活动需要很长时间才能加载,如果我删除图像,活动会很好,否则需要一段时间才能加载,我尝试对 PNG 做同样的事情不同尺寸的相同图像的文件,按图像和像素的大小缩小,因此它应该很轻,同时我的设备仍然加载很长时间的活动。设备是华为 p8 Lite,我认为这不是设备问题,任何人都有这种情况的最佳做法?非常感谢。

4

0 回答 0