I need to rotate the layout (there are TextView and ImageView), and it needs to be placed to the right and top in the RelativeLayout. I create my layout, this layout is placed on the right. But if I rotate it, I cannot align it to the right. What should I do?
My relative layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:background="@drawable/background" android:layout_height="wrap_content" android:id="@+id/testRL"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:id="@+id/testRotateLL"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="@drawable/picture_border_offer_first_page" /> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="7000TL" android:textSize="15sp" android:layout_centerInParent="true" android:textColor="@android:color/white" android:id="@+id/amountLayoutTV" /> </RelativeLayout> </RelativeLayout>
And I rotate this linearLayout with animation. It rotates well, ..
<rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="45" android:pivotX="50%" android:pivotY="50%" android:fillEnabled="true" android:detachWallpaper="true" android:duration="0" android:fillAfter="true"> </rotate>
After turning a new visual ...
source share