如何让popupwindow 显示在整个屏幕的中央
2个回答
展开全部
这个简单又好用
AlertDialog.Builder builderAlert = new AlertDialog.Builder(this);
builderAlert.setTitle("更换头像");
myview = View.inflate(UserActivity.this,
R.layout.choose_photo_buttom, null);
builderAlert.setView(myview);
dialog = builderAlert.show();
//默认在中间,下面3行是从底部弹出的动画,
/* Window window = dialog.getWindow();
window.setGravity(Gravity.BOTTOM);
window.setWindowAnimations(R.style.mystyle); // 添加动画
*/ dialog.show();
AlertDialog.Builder builderAlert = new AlertDialog.Builder(this);
builderAlert.setTitle("更换头像");
myview = View.inflate(UserActivity.this,
R.layout.choose_photo_buttom, null);
builderAlert.setView(myview);
dialog = builderAlert.show();
//默认在中间,下面3行是从底部弹出的动画,
/* Window window = dialog.getWindow();
window.setGravity(Gravity.BOTTOM);
window.setWindowAnimations(R.style.mystyle); // 添加动画
*/ dialog.show();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询