I have an opaque pattern (10% opacity) and I need to combine it with some color.
Is it possible to set background color to image?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure. Just use a LayerListDrawable.
Something like:
Save that in your
res/drawablesdirectory, and use it as your background.Sadly, if your application is more complicated, sometimes the tileMode will get unset for no apparent reason. If you run in to that, you’ll have to re-add the tile mode in Java.
I usually still set it in xml, and then do something like: