Picture instead of color in background?

0 Dhananjay Kumar · May 27, 2015
Hello,

Can someone please tell me how to add picture of gradient instead of color (android:backgroundColor) ? 

Post a Reply

Replies

Oldest  Newest  Rating
0 Abhinav Moudgil · May 29, 2015
Steps to be followed:

1. Copy your picture here: app/res/drawable/picturename.jpg
2. Give your picture an id, say, mypic.
3. Add this line in your XML file: 
android:background="@drawable/mypic"

Done!

Suggestion: Keep all letters in picture name lowercase other it may raise build error.
  • 1

Java / Android Development

107,116 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator