安卓paint相关细节

getTextBounds获取显示字符串的显示范围

void getTextBounds (String text, 
                int start, 
                int end, 
                Rect bounds)

start为起始索引、end为字数,bounds为范围,可用bounds.left - bounds.left 获取int型显示范围长度

 

这个地址告诉了我们怎么样多次裁剪画布。android 9之前的Rgion.Op很多参数已经废弃了

https://stackoverflow.com/questions/50231950/what-is-the-best-alternative-to-canvas-cliprect-with-region-op-replace

你可能感兴趣的:(安卓)