전체 화면 투명 배경 대화상자

투명한 배경 대화상자

        AlertDialog.Builder mBuilder = new AlertDialog.Builder(this, R.style.full_screen_dialog);
        View view = LayoutInflater.from(this).inflate(R.layout.item_list, null);
        mBuilder.setView(view);

        Dialog mDialog = mBuilder.create();
        Window win = mDialog.getWindow();
        // , Activity , 。
        win.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        win.setWindowAnimations(R.style.anim_dialog_bottom);

        // 
        WindowManager.LayoutParams params = win.getAttributes();
        params.gravity = Gravity.BOTTOM;
        win.setAttributes(params);

        mDialog.show();

전체 화면 스타일:

  <style name="full_screen_dialog">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
        <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
    </style>

좋은 웹페이지 즐겨찾기