Android的drawTextRun方法使用

android存在很多drawText方法,这个方法怎么用的。

这是在api21以上才可以使用的新方法。具体的参数如下

     /**
     * drawTextRun(CharSequence text, int start, int end, int contextStart,int contextEnd,
     *              float x, float y, boolean isRtl,Paint paint)
     *  注意:0<= contextStart <= start <=end <= contextEnd <= text.length
     *  isRtl:是否是从右往左绘制,true是;false:从左往右。
     */
    CharSequence textRun = "I`m an andoter";
    //canvas.drawTextRun(text, 0, 10, 0,text.length(),20, 60, true,paint);