我应该错开大量的图像加载调用吗?

Fat*_*tie 0 android listview android-imageview

我有一个带有~100个大图像的ListView.每幅图像约为640.640 jpg,显示为1/2屏幕尺寸.典型的画廊.

我目前正在使用精彩的universal-image-loader-1.9.2加载图像.

ParseFile photoFile = p.getParseFile("imageFile");
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage( photoFile.getUrl(), theImageView );
Run Code Online (Sandbox Code Playgroud)

现在,当你加载时,你会在ListView上得到一些口吃.

现在,巧合的是,我把手机放在一个非常慢的WiFi网络上.事实上,它是光滑的.

起初,我无法解决为什么突然改善!情缘!

事实上,在那种情况下:是否值得错开加载图像的调用?

因此,我可以在每次通话之间留下0.1".

或者,如果我只是这样做,可能会跟随另一个吗?!

这有什么交易?所有的android工程师都会这么做吗? 干杯!

我已经应用了所有其他经典技术,我已经google了黄油光滑的ListView滚动.干杯

(请注意,我已经尝试了许多系统来加载图像,但没有什么区别,这不是通用图像加载器的问题.


ashishduh,这是来自getView的代码......如你所见,它是微不足道的.

(注意 - 设置大小没有区别.如果我尝试用500.500固定,它是相同的)

...
v.someTextView.setText(blah);
v.someTextView.setText(blah);

// and now the big image
if (p.containsKey("imageFile"))
    {
    // this cell has a big image

    v.mainImage.setVisibility(View.VISIBLE);
    ParseFile photoFile = p.getParseFile("imageFile");

    // ...using p.getNumber("imageWidth").floatValue(); and height
    // from the cloud, calculate needed width/height on the phone...

    v.mainImage.getLayoutParams().width = Math.round(desiredGlassWidth);
    v.mainImage.getLayoutParams().height = Math.round(desiredGlassHeight);

    ImageLoader imageLoader = ImageLoader.getInstance();
    imageLoader.displayImage( photoFile.getUrl(), v.mainImage );
    }
else
    {
    // this pcell has no big image
    v.mainImageIV.setVisibility(View.GONE);
    }
...
Run Code Online (Sandbox Code Playgroud)

Fat*_*tie 5

对于在这里谷歌搜索的任何人的记录......

我只是尝试毕加索 ...根据评论中的建议(谢谢)

真的,这太棒了.只有Volley会更好.

毕加索工作得很好,我关于错开图像调用的问题毫无意义.

http://square.github.io/picasso/

希望它可以帮到某人!

任何更好的答案,在这里发布点数!


PS1的一个重点是毕加索有一个"取指令"命令,这是一个预热.在某些情况下,您可以使用它来获得更好的结果.

正如我在上面提到的那样,PS2是唯一比毕加索更好的事情,就是转向Volley.希望它可以帮助某人.