gpt4 book ai didi

安卓 : change the position of alert dialog icon

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:16:08 25 4
gpt4 key购买 nike

我在 android xml 文件中有一个警告对话框。我的警告对话框的左侧有一个图标。我想将图标的位置更改为右侧。我不想也使用自定义对话框

像这样:

enter image description here

最佳答案

要将警报对话框的布局方向设置为 RTL,您可以使用 OnShowListener 方法。设置 title , message , .... 使用这个方法。

 dialog = alertdialogbuilder.create();

dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dlg) {

dialog.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL); // set title and message direction to RTL
}
});
dialog.show();

关于安卓 : change the position of alert dialog icon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27505691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com