public void drawText(String text, float x, float y,Paint paint)

Parameters:
text The text to be drawn     //要绘制的文本
x The x-coordinate of the origin of the text being drawn //要绘制文本起始点的x坐标
y The y-coordinate of the origin of the text being drawn //要绘制文本起始点的y坐标
paint The paint used for the text (e.g. color, size, style) //画笔

这里要特别说明的一点是:origin,起始点指的是从该点右上区域开始绘制文本,也就是绘制文本区域的左下角的点。

Paint.FontMetrics

Fields

如下属性主要表示画笔绘制区域内文本与边框的距离:

public float ascent The recommended distance above the baseline for singled spaced text. //某个文本基线往上的距离(为负数)
public float bottom The maximum distance below the baseline for the lowest glyph in the font at a given text size. //以一行文本最靠下的位置为基线往下的距离
public float descent The recommended distance below the baseline for singled spaced text. //某个文本基线往下的距离
public float leading The recommended additional space to add between lines of text. //行与行之间距
public float top The maximum distance above the baseline for the tallest glyph in the font at a given text size. //以一行文本最靠上的位置为基线往上的距离(为负数)

 

更多相关文章

  1. Android TextView Justify Text TextView自适应文本
  2. android 的文本框输入类型
  3. android文本限制输入行数,多余部分显示省略号
  4. Android文本输入框EditText属性和方法说明
  5. android 输出.txt 文本换行问题
  6. Android 自定义文本框(带图片)
  7. 捕获Android文本输入框的软键盘完成(Done)按键消息
  8. Android下载网络文本

随机推荐

  1. Android应用开发中的风格和主题(style,th
  2. 【Android】第7章(2)--布局控件常用的公共
  3. Android 实现多行文本跑马灯效果
  4. Android MTK 修改默认音频和声音大小
  5. 毫无保留开源我写的:IOS Android Ipad 多
  6. Android中PreferenceFregment使用完全攻
  7. Mac电脑开发Android app如何连接真机
  8. Android的7种进度条样式
  9. Android软件安全风险及规范
  10. Android shell 系统命令大全