带输入框的自定义dialog 点击外部消失 输入框可以弹出软键盘 去除外部黑框


final Dialog dialog = new Dialog(mContext, R.style.dialog);
View   view   = LayoutInflater.from(mContext)
                              .inflate(R.layout.dialog_wifi, null);
dialog.setCanceledOnTouchOutside(true);
dialog.setContentView(view);
dialog.show();
 
  

<style name="dialog" parent="@android:style/Theme.Dialog">
    <item name="android:windowFrame">@nullitem>
    <item name="android:windowIsFloating">trueitem>
    <item name="android:windowIsTranslucent">falseitem>
    <item name="android:windowNoTitle">trueitem>
    <item name="android:background">@nullitem>
    <item name="android:backgroundDimEnabled">trueitem>
    <item name="android:windowBackground">@android:color/transparentitem>
style>

你可能感兴趣的:(带输入框的自定义dialog 点击外部消失 输入框可以弹出软键盘 去除外部黑框)