---
title: "123123"
author: "想gohome"
date: "2011-12-20T18:31:29Z"
tags: []
categories: ["非技术"]
slug: "123123"
draft: false
lastmod: "2011-12-20T18:31:29Z"
id: 1318526
url: "https://hellocg86-gmail-com.iteye.com/blog/1318526"
---

@Override
		protected void onDraw(Canvas canvas) {
			if(widths==null){
				return;
			}
			super.onDraw(canvas);
			String str;
			Paint paint = new Paint();
			paint.setTextSize(textSize);
			
			int x = 0 ;
			int y= 0;
			canvas.translate(-offsetPoint.x + identityColumnWidth, -offsetPoint.y+ (lineHeight + space));
			
			for(int i=0;i<columns.length;i++){//内容
				if(showColumns*){
					for(int j=0;j<contents.length;j++){
						y=j*(lineHeight+space);
						str = contents*;
						drawTextOnCanvas(x+(widths*-measureStringWidth(paint, str))/2, y+space/2, canvas, str, paint);
					}
					x+=widths*;
				}
			}
			
			canvas.translate(offsetPoint.x - identityColumnWidth, offsetPoint.y- (lineHeight + space));
			canvas.translate(-offsetPoint.x + identityColumnWidth, 0);
			
			x=0;
			y=0;
			for(int i=0;i<columns.length;i++){//表头
				str = columns*;
				if(showColumns*){
					drawTextOnCanvas(x+(widths*-measureStringWidth(paint, str))/2, y+space/2, canvas, str, paint);
				}
				x+=widths*;
			}
			
			canvas.translate(offsetPoint.x - identityColumnWidth, 0);
			canvas.translate(0, -offsetPoint.y + (lineHeight + space));
			
			x=0;
			y=0;
			for(int i=0;i<contents.length;i++){//行数
				str =(i+1)+"";
				y = i*(lineHeight+space);
				drawTextOnCanvas(x+(identityColumnWidth-measureStringWidth(paint, str))/2, y+space/2, canvas, str, paint);
			}
			
		}
	}