Skip to content Skip to sidebar Skip to footer

How To Put Textview Like Image With The Use Of Canvas?

I already implemented upper view with reference to this ans How to make a view like this ? Actually I tried with drawble views but can't get it5075 I tried public class Canva

Solution 1:

To place the text do as follows in onDraw:

float midline_segment = (5-1)/2 * interlinesegments + rectwidth/2;
canvas.drawText("Order transmitted XYZ", 
coordbounds.left +  midline_segment, 
coordbounds.centerY()+40,tPaint);

Make sure that you set the alignment correctly in the Paint object:

tPaint.setTextAlign(Paint.Align.CENTER);

Post a Comment for "How To Put Textview Like Image With The Use Of Canvas?"