我觉得这很有用presentation 这段代码来自它:
public class BookshelfGridView extends GridView {
// Constructors etc
protected void dispatchDraw(Canvas canvas) {
for (int y = top; y < height; y += mWoodPanelHeight) {
for (int x = mLeftWidth; x < width; x += mWoodPanelWidth) {
canvas.drawBitmap(mWoodPanelImage, x, y, null);
}
}
for (int y = top; y < height; y += mShelfHeight) {
// Draw left edge
// Draw shelf
// Draw right edge
}
super.dispatchDraw(canvas);
}
}
但有些事情并不清楚,例如:
并提前致谢