I have an activity and this is its layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@drawable/main_background" >
</RelativeLayout>
main_background is a rotate xml. There are two main_background xml for each orientation
drawable-hdpi/main_background.xml :
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/sss" >
</rotate>
drawable-land-hdpi/main_background.xml :
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="90"
android:toDegrees="90"
android:drawable="@drawable/sss" >
</rotate>
So I want to use the same .jpg file but different rotation for horizontal and vertical orientation. For example, When orientation changes to horizontal , I want to rotate drawable 90 degrees. But here is my results :
Vertical orientation (There is no problem with this):
Horizontal orientation (which is my problem):
What i want (without any resizing):
How can i do that ?