美文网首页
Dialog中EditText自动弹出键盘

Dialog中EditText自动弹出键盘

作者: Mr_J316 | 来源:发表于2019-04-13 15:22 被阅读0次

给editText设置获取焦点

editText.requestFocus();

给dialog设置style

AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.DialogTheme);
<style name="DialogTheme" parent="Base.Theme.AppCompat.Light.Dialog">
        <!--弹出软键盘-->
        <item name="android:windowSoftInputMode">stateVisible</item>
    </style>

相关文章

网友评论

      本文标题:Dialog中EditText自动弹出键盘

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