2015年6月4日
摘要: 理解:x:要绘制文本的x坐标,y:baseline1.首先调整字符的坐标系为中心,paintUnselectWeekText.setTextAlign(Paint.Align.CENTER);2.将字符的中心与要绘制的地方的中心对其,那么文字就居中了canvas.drawText("the text... 阅读全文
posted @ 2015-06-04 21:53 猿类的进化史 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 引入属性的两种命名空间方式:xmlns:yournamespace="http://schemas.android.com/apk/res/包名"或者 xmlns:yournamespace="http://schemas.android.com/apk/res-auto"因为命名空间引入错误,不会... 阅读全文
posted @ 2015-06-04 18:25 猿类的进化史 阅读(105) 评论(0) 推荐(0) 编辑
摘要: (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, mTextSize, context.getResources().getDisplayMetrics())a.getDimensionPixelSize(R.styleable.... 阅读全文
posted @ 2015-06-04 16:51 猿类的进化史 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Rect rect= new Rect();Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG);textPaint.setTextAligh(Paint.Align.Right);textPaint.setTextSize(12);textPaint... 阅读全文
posted @ 2015-06-04 00:06 猿类的进化史 阅读(893) 评论(0) 推荐(0) 编辑