摘要: 转自http://blog.csdn.net/wangkuifeng0118/article/details/7944215书架效果: 下面先看一下书架的实现原理吧! 首先看一下layout下的布局文件main.xml 1 2 8 9 10 23 24 31 32 33 40 41 53 54 55 56 57 58 上面是个自定义的gridview主要来实现书架,因为每一本书是一个item,在自定义的grid... 阅读全文
posted @ 2013-11-06 11:57 xplee 阅读(1346) 评论(0) 推荐(0) 编辑
摘要: 转载自http://blog.csdn.net/linghu_java/article/details/8595717 Android中加载一个Bitmap(位图)到你的UI界面是非常简单的,但是如果你要一次加载一大批,事情就变得复杂多了。在大多数的情况下(如ListView、GridView或者ViewPager这样的组件),屏幕上的图片以及马上要在滚动到屏幕上显示的图片的总量,在本质上是不受限制的。像这样的组件在子视图移出屏幕后会进行视图回收,内存使用仍被保留。但假设你不保留任何长期存活的引用,垃圾回收器也会释放你所加载的Bitmap。这自然再好不过了,但是为了保持流畅且快速加载的UI,. 阅读全文
posted @ 2013-11-06 11:29 xplee 阅读(468) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.... 阅读全文
posted @ 2013-11-06 11:09 xplee 阅读(1706) 评论(0) 推荐(0) 编辑
摘要: 1 package android.util; 2 3 import java.util.LinkedHashMap; 4 import java.util.Map; 5 6 /** 7 * A cache that holds strong references to a limited number of values. Each time 8 * a value is accessed, it is moved to the head of a queue. When a value is 9 * added to a full c... 阅读全文
posted @ 2013-11-06 10:59 xplee 阅读(723) 评论(0) 推荐(1) 编辑