gpt4 book ai didi

android - 如何更改警报对话框的位置

转载 作者:太空宇宙 更新时间:2023-11-03 12:38:38 24 4
gpt4 key购买 nike

我有一个使用 Alertdialog 的 android 应用程序。我正在为此对话框设置动画。我想从左上角开始动画并在右下角结束。即,对话框想要从左上角移动到右下角在动画持续时间内。

我怎样才能做到这一点?

最佳答案

试试这个

AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Final Result");
alert.setMessage(msg);
alert.setPositiveButton("OK",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub

}

});


// dlgAlert.create();
AlertDialog dialog_card = alert.create();
// dlgAlert.requestWindowFeature(Window.FEATURE_NO_TITLE);
// WindowManager.LayoutParams WMLP =
dialog_card.getWindow().setGravity(Gravity.TOP);

dialog_card.show();`

关于android - 如何更改警报对话框的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12563687/

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