Is there any way in Android to draw a filled rectangle with say a black border. My problem is that the canvas.draw() takes one paint object, and to my knowledge the paint object can't have a different color for the fill and the stroke. Is there a way around this?
Android – Drawing a filled rectangle with a border in android
androidandroid-canvasborderfillpaint
Related Topic
- Android – How to stop EditText from gaining focus at Activity startup in Android
- Android – n easy way to add a border to the top and bottom of an Android View
- Android – unique Android device ID
- Android – ‘Context’ on Android
- Android canvas draw rectangle
- Java – Proper use cases for Android UserManager.isUserAGoat()
Best Answer
Try paint.setStyle(Paint.Style.FILL) and paint.setStyle(Paint.Style.STROKE).