Created
April 15, 2016 09:29
-
-
Save shau-lok/b45a5069179df55f63fb9fd93b547944 to your computer and use it in GitHub Desktop.
ShapeDrawable 用法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShapeDrawable rectChecked = new ShapeDrawable(new RectShape()); | |
rectChecked.getPaint().setColor(0xfffffff); | |
rectChecked.getPaint().setStyle(Paint.Style.STROKE); | |
rectChecked.getPaint().setStrokeWidth(strokeWidth); | |
rectChecked.setIntrinsicHeight(bitmap.getHeight() + strokeWidth); | |
rectChecked.setIntrinsicWidth(bitmap.getWidth() + strokeWidth); | |
Drawable[] drawableArray = new Drawable[]{bmp,rectChecked}; | |
LayerDrawable layerChecked = new LayerDrawable(drawableArray); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment