[英]High quality images in imageview?
我正在使用LazyAdapter将图像从url加载到imageview中。 http://www.hdwallpapers.in/walls/parrot_high_resolution-normal.jpg进入imageview,看起来太可怕了! 有谁知道如何修理它? 这是我的代码:
final JSONArray jArray = new JSONArray(result);
for (int i = 0; i < jArray.length(); i++) {
HashMap<String, String> hm = new HashMap<String, String>();
JSONObject json = jArray.getJSONObject(i);
hm.put("phoneimage", json.getString("imageurl"));
resultList.add(hm);
}
arrowfront.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
position++;
HashMap<String, String> frontHm = new HashMap<String, String>();
imageLoader.DisplayImage(frontHm.get("phoneimage"),themainimage);
至于xml:
<ImageView
android:id="@+id/ivdisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
我之前已经实现了LazyAdapter,并且在将位图处理到UI之前对位图进行了编码,因为将高质量的图像加载到UI将导致大量内存使用,这将迫使应用程序关闭,我已经研究了您提供的示例代码正如您在ImageLoader类中看到的那样,第89行有对位图的编码。
转到类ImageLoader并搜索final int REQUIRED_SIZE=70;
然后将70
更改为200
,看看是否有帮助。
您可以在此处http://code.google.com/p/android-query/downloads/detail?name=android-query.0.25.10.jar使用Android查询rom
并在您的imageView上实现
AQuery aq = new AQuery(ImageView); // your imageview object
aq.id(R.id.imageview).image("urlofImage");
它将自动将图像设置为您的imagevew
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.