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

Android

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndroiDBeginnerView Question on Stackoverflow
Solution 1 - AndroidJohn FeminellaView Answer on Stackoverflow