a) If you use it as drawn in the dialog header (TextView), just use drawableRight
android:drawableRight="@drawable/yourIcon"
b) If it is ImageView / ImageButton in RelativeLayout, use alignParentRight
android:layout_alignParentRight="true"
c) If it is ImageView / ImageButton in LinearLayout, put it after TextView
<LinearLayout android:layout_width="300dp" android:layout_height="300dp"> <TextView android:text="some text" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ImageView android:src="@drawable/yourIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
Hope this helps you.
Gonzalo ledezma torres
source share