我有一个使用 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/