I have a simple gradient background for my app.
So is there a way to set it so when the orientation is changed from Vertical to Landscape, the background changes to a bigger version of picture (a seperate picture, but same gradient effect)?
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.
say you are using this image as a background in the main.xml layout file. what you have to do is create a new folder in ‘res’ directory named ‘layout-land’
now you have two different main.xml files. Android OS will automatically pickup the correct layout according to the orientation.
please note that widgets in patriot main.xml file should exist in landscape main.xml too with the same ID. otherwise you will get nullpointer.