如何实现被键盘遮挡时,带有textfield的tableview自动上移
1个回答
展开全部
以前自己写AlertDialog时也遇到这个问题,下面代码解决了我的问题
ad = new AlertDialog.Builder(activity).create();
LayoutInflater inf = (LayoutInflater) activity.getSystemService(activity.LAYOUT_INFLATER_SERVICE);
View v = inf.inflate(R.layout.dialog_view, null);
ad.setView(v);
ad.show();
Window wd = ad.getWindow();
wd.setContentView(R.layout.dialog_view);
WindowManager.LayoutParams lp = wd.getAttributes();
lp.x = 0;
lp.width = CommFunction.MyDialogWidth;
lp.height = (int) (CommFunction.MyDialogHeight*0.7);
lp.alpha = 0.97f;
wd.setAttributes(lp);
希望对你有帮助
ad = new AlertDialog.Builder(activity).create();
LayoutInflater inf = (LayoutInflater) activity.getSystemService(activity.LAYOUT_INFLATER_SERVICE);
View v = inf.inflate(R.layout.dialog_view, null);
ad.setView(v);
ad.show();
Window wd = ad.getWindow();
wd.setContentView(R.layout.dialog_view);
WindowManager.LayoutParams lp = wd.getAttributes();
lp.x = 0;
lp.width = CommFunction.MyDialogWidth;
lp.height = (int) (CommFunction.MyDialogHeight*0.7);
lp.alpha = 0.97f;
wd.setAttributes(lp);
希望对你有帮助
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询