ImageView导致延迟 [英] ImageView causes lag

查看:97
本文介绍了ImageView导致延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个ImageView.我的图片的第一个版本一切正常: 图像的版本1 .但是,当我更新图像时:图像的版本2 ,我的GUI开始滞后! /p>

例如,单击按钮的动画仅显示3到4帧!

但是对我而言,这没有任何意义.这两个图像均为png,并且具有透明背景.导致滞后的图像甚至比旧图像更小.

解决方案

将图像移动到drawable-nodpi文件夹,并查看它是否有所不同.理想情况下,您应该将不同分辨率的不同尺寸的图像放在不同的文件夹中,以便缩放不会引起延迟.

I have a ImageView in my app. Everything was fine with the first version of my image: Version 1 of image. But when I updated the image: Version 2 of image, my GUI starts to lag!

For example the animation of a button-click is just displayed with 3~4 frames!

But for me it makes no sense. Both images are png and have a transparent background. The image that causes the lags is even smaller than the old one.

解决方案

Move the image to a drawable-nodpi folder and see if it makes a difference. Ideally you should put different size images for different resolutions in different folders so that scaling does not cause lags.

这篇关于ImageView导致延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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