美文网首页
AlertDialog中EditText无弹出键盘解决办法

AlertDialog中EditText无弹出键盘解决办法

作者: 梦沉薇露 | 来源:发表于2016-08-17 18:08 被阅读0次

private void showMyDialog(int layoutId){
LayoutInflater inflater = LayoutInflater.from(mContext);
View fourView = inflater.inflate(layoutId, null);
AlertDialog myDialog = new AlertDialog.Builder(context).create(); //加上以下这句代码
myDialog .setView(((Activity) mContext).getLayoutInflater().inflate(layoutId, null))
myDialog .show();
myDialog .getWindow().setContentView(fourView);
}

相关文章

网友评论

      本文标题:AlertDialog中EditText无弹出键盘解决办法

      本文链接:https://www.haomeiwen.com/subject/ybgmsttx.html