Reputation: 2815
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)?
Upvotes: 2
Views: 1505
Reputation: 23596
You should have to create the another directory as Asanka have said in answer and do it. That solve your issue.
For more information see this.
Enjoy. :)
Upvotes: 0
Reputation: 4730
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.
Upvotes: 4