I want to place the image to the right of the view. For this I use something like
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > ...some other elements <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/imageIcon" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="right" android:src="@drawable/image_icon" > </ImageView> </LinearLayout> ... </RelativeLayout>
The above image puts the image somewhere in the center. How to ensure the correct alignment of the image, regardless of whether we are in portrait or landscape mode?
Thanx!
source share