On an Android Activity, I want to set an image as the background in the bottom left corner. Here’s how you do it: Background Image Placement
However, I also want to be able to specify that the rest of the background which is not this image has a certain color. Is this possible?
(It’s so I can have a background which is one solid color with a small logo in one corner)
Thanks,
EDIT:
I have done a test project which apparently should work, but it crashes for me. https://github.com/jarofgreen/AndroidTestBackground E/AndroidRuntime(213): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class
I solved this by using a 9-patch image.
http://developer.android.com/guide/developing/tools/draw9patch.html
I made a 9-patch image with a wide area of background color and set the background color as the expandable area.
Then just set this image as the background of the view!
(One thing I don’t understand tho, I thought content would only be placed in the expandable area, leaving a wide margin on the left and bottom. We were going to accept that as a necessary sacrifice but actually content appears over all parts of the background. )