Issue
I'm trying to set a Bitmap Drawable as the background like this, root.setBackground(bitmapDrawable);, I've set its bounds to be 1080 wide by 300 high, but it keeps stretching to fit the entire background. Is there any way to avoid this? This is how i created the BitmapDrawable BitmapDrawable bitmapDrawable= new BitmapDrawable(getResources(), bmp1);
Solution
I believe the default Gravity of a BitmapDrawable is FILL. Try setting the Gravity to CENTER:
bitmapDrawable.setGravity(Gravity.CENTER);
Answered By - Bryan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.