我在
android xml文件中有一个警告对话框.我的警告对话框左侧有一个图标.我想将图标的位置改为右侧.
我也不想使用custum对话框
我也不想使用custum对话框
像这样 :
解决方法
a)如果你在对话框标题(TextView)中将它作为drawable,只需使用drawableRight
android:drawableRight="@drawable/yourIcon"
b)如果它是RelativeLayout中的ImageView / ImageButton,请使用alignParentRight
android:layout_alignParentRight="true"
c)如果它是LinearLayout中的ImageView / ImageButton,则将其放在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>
希望这对你有所帮助.