如何创建带有动画的Android模式弹出窗口?
我试图在Android中创建一个类似于(10秒)的模式弹出效果。我想弹出一个“窗口”,上面有文本视图和网络视图,有动画,背景模糊或变暗。我已经搜索过AlertDialog、PopupWindow和Activity对话框,但我不确定哪种对话框(如果有的话)最合适。实现这一点的最佳方法是什么?为此使用对话框:如何创建带有动画的Android模式弹出窗口?,android,dialog,popup,modal-dialog,alert,Android,Dialog,Popup,Modal Dialog,Alert,我试图在Android中创建一个类似于(10秒)的模式弹出效果。我想弹出一个“窗口”,上面有文本视图和网络视图,有动画,背景模糊或变暗。我已经搜索过AlertDialog、PopupWindow和Activity对话框,但我不确定哪种对话框(如果有的话)最合适。实现这一点的最佳方法是什么?为此使用对话框: public class AppDialog extends Dialog { View mainView; public AppDialog(@NonNull Context cont
public class AppDialog extends Dialog {
View mainView;
public AppDialog(@NonNull Context context) {
super(context);
mainView = LayoutInflater.from(context).inflate(R.layout.app_date_picker_dialog,null);
addContentView(mainView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
}
请参加您的活动:
AppDialog dialog = new AppDialog(context);
dialog.show();
谢谢!如何设置对话框弹出和关闭的动画?