android.graphics.Paint is the class used to define styles and colors used to draw on a canvas. One of the methods in this class is setTextAlign which can be used to set the text alignment in a text block.
The syntax for using setTextAlign method:
paint.setTextAlign(Paint.Align.CENTER);
Example:
This example sets the text alignment to center in a TextView:
The package library for android.graphics.Paint is android.graphics.
Java Paint.setTextAlign - 30 examples found. These are the top rated real world Java examples of android.graphics.Paint.setTextAlign extracted from open source projects. You can rate examples to help us improve the quality of examples.