I'm wondering if it's possible to align the background
of a View
in android. I have an image as a BitmapDrawable
that I would like to fill and align it's right edge with the View
.
I was using the Gravity.CENTER
value in order to keep the background
's contents centered, but now I need to have the image as the background
, but align its right edge to the View
's right edge, while still filling the entirety of the View
, cropping the extra.
Is this possible?
EDIT:
Oops. The "What have I tried?" part is missing.
I've tried setting the gravity to Gravity.RIGHT
, but that just ended up centering and shrinking the background.
Setting (Gravity.CENTER | Gravity.RIGHT)
also had the same results.
I've tried looking on google, but it only spoke of using an ImageView
, but I need to have View
s in this View
.
So, thats what I've tried and I don't know what else to do.
EDIT 2:
To be clear, I'm talking about this