If I got a graphic design for lets say a TextEdit control as a background image, is it possible to stretch the image when changing from portrait to landscape view?
I'm coming from WEB and with CSS where I could divide the background picture to 3 parts and make the background stretch dynamically. Is something like this possible in android environment or should I use different layouts for each orientation?
You can declare different graphics by dropping them in separate sub-folders of the /res directory in your project. By naming convention, your application will pick them up automatically.
For example, if you use a background image called textBackground.png and you have two versions of it depending on orientation. The app will use res/drawable/textbackground.png by default and res/drawable-land/textBackground.png when in landscape mode, for example.
Check out this doc for the full story:
http://developer.android.com/guide/topics/resources/providing-resources.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With