Skip to content

Commit 0a8fb3e

Browse files
committed
Update
1 parent 0ad6f87 commit 0a8fb3e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎CustomView/Fix/DrawText.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## 错误原因
1010

11-
这个错误是drawText方法中坐标的一个问题,就一般的绘图而言,坐标一般都是指定左上角,然而drawText默认并不是左上角,甚至不是大家测试后认为的左下角,而是一个**由Paint中Align决定的对齐基准线**,该API原文如下:
11+
这个错误是drawText方法中坐标的一个问题,就一般的绘图而言,坐标一般都是指定左上角,然而drawText默认并不是左上角,甚至不是大家测试后认为的左下角,而是一个**由Paint中Align决定的对齐基准线**,该API注释原文如下:
1212

1313
> Draw the text, with origin at (x,y), using the specified paint. **The origin is interpreted based on the Align setting in the paint.**
1414
@@ -31,6 +31,17 @@
3131
![](http://ww3.sinaimg.cn/large/005Xtdi2gw1f3ko9oln9lj30dw08cmxo.jpg)<br/>
3232
**综上所述,基线y放到下面不仅符合人的书写习惯,而且更加便于设计。**
3333

34+
## drawText从入门到懵逼
35+
36+
drawText是Canvas提供的一个方法,使用起来也比较简单,但是想玩出花样,单单的会使用这些方法是远远不够的。
37+
38+
**drawText方法的使用可以参见这一篇文章:[【安卓自定义View进阶 - 图片文字】](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B4%5DCanvas_PictureText.md) 这里就不多啰嗦了,接下来我们将会了解一些更加好玩的东西。**
39+
40+
### drawText & Paint
41+
42+
虽然在 [图片文字](https://github.com/GcsSloop/AndroidNote/blob/master/CustomView/Advance/%5B4%5DCanvas_PictureText.md) 这篇文章中有简单的了解部分方法,但并没有深入的去讲解,本次将会详细的讲解其中的各个方法。
43+
44+
3445

3546

3647

0 commit comments

Comments
 (0)