AndroiDBeginner
AndroiDBeginner

Reputation: 3599

How do you set a line's width when drawing in Android?

How to set line width? What method is used for it?

Upvotes: 51

Views: 42117

Answers (1)

John Feminella
John Feminella

Reputation: 311446

Check out Paint.setStrokeWidth().

You draw by making various Drawable objects. The objects themselves are separated from the instructions about how to draw them; that's covered by the Paint class. Paint instances have a method that allows you set the width of the stroke that will be used to draw the objects, setStrokeWidth(), which is what you want.

Upvotes: 100

Related Questions