开发者

Divide String over 2 custom Rect shapes in onDraw();

开发者 https://www.devze.com 2023-03-17 13:32 出处:网络
I\'m having issues dividing my String object over 2 Rect shapes. Firstly i have no idea how to set canvas.drawtext to a specified region.

I'm having issues dividing my String object over 2 Rect shapes.

Firstly i have no idea how to set canvas.drawtext to a specified region. Like you would do if you use textview.

Secondly I can only calculate / break my string at the width of the Rect shape. meaning I can only draw 1 line instead of filling out the box... I could take the box height and divide it by the textsize to calc the number of lines that fit, but then i would have to draw line by line ?

sur开发者_JAVA技巧ely there must be examples for this , but i cannot seem to find them.

somewhat the situation :

View :

[xxxxx]----------

[xxxxx]----------

----------[xxxxx]

----------[xxxxx]

i want a very long string to be divided and placed at the [xxx] boxes

ta.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号