w.donahue
w.donahue

Reputation: 10886

Android android:background auto rotate option

I set a background image to a layout via the android:background property. I want the image to rotate when displayed in a landscape orientation. Right now it keeps its same orientation and gets stretched badly.

To fix I rotated the image myself in Photoshop and put one copy in drawable-port and one in drawable-land. While this does fix the issue, it causes me to grow the app size by a few megs to fit alternate versions of all the images. Is there anyway to do this via the xml without the need for extra copies of the images?

Thank you kindly

Upvotes: 0

Views: 5319

Answers (1)

Aleadam
Aleadam

Reputation: 40391

I did not test it, bu I would use the android:rotation attribute in the drawable-land to rotate the same image resource 90 degrees.

Upvotes: 3

Related Questions