<tfoot id='vuaEj'></tfoot>
<i id='vuaEj'><tr id='vuaEj'><dt id='vuaEj'><q id='vuaEj'><span id='vuaEj'><b id='vuaEj'><form id='vuaEj'><ins id='vuaEj'></ins><ul id='vuaEj'></ul><sub id='vuaEj'></sub></form><legend id='vuaEj'></legend><bdo id='vuaEj'><pre id='vuaEj'><center id='vuaEj'></center></pre></bdo></b><th id='vuaEj'></th></span></q></dt></tr></i><div id='vuaEj'><tfoot id='vuaEj'></tfoot><dl id='vuaEj'><fieldset id='vuaEj'></fieldset></dl></div>

  • <small id='vuaEj'></small><noframes id='vuaEj'>

    <legend id='vuaEj'><style id='vuaEj'><dir id='vuaEj'><q id='vuaEj'></q></dir></style></legend>
    • <bdo id='vuaEj'></bdo><ul id='vuaEj'></ul>

      1. 使用 Dialog 自定义屏幕变暗

        时间:2023-08-29
      2. <i id='u51al'><tr id='u51al'><dt id='u51al'><q id='u51al'><span id='u51al'><b id='u51al'><form id='u51al'><ins id='u51al'></ins><ul id='u51al'></ul><sub id='u51al'></sub></form><legend id='u51al'></legend><bdo id='u51al'><pre id='u51al'><center id='u51al'></center></pre></bdo></b><th id='u51al'></th></span></q></dt></tr></i><div id='u51al'><tfoot id='u51al'></tfoot><dl id='u51al'><fieldset id='u51al'></fieldset></dl></div>
                <tbody id='u51al'></tbody>
                <bdo id='u51al'></bdo><ul id='u51al'></ul>
              • <legend id='u51al'><style id='u51al'><dir id='u51al'><q id='u51al'></q></dir></style></legend>

              • <tfoot id='u51al'></tfoot>

                  <small id='u51al'></small><noframes id='u51al'>

                  本文介绍了使用 Dialog 自定义屏幕变暗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  在 Android 中,当您弹出一个对话框时,它后面的屏幕会变暗.有什么办法可以控制它的外观吗?例如使其变暗或使用某种模式?

                  In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern?

                  推荐答案

                  是的.你可以控制它.

                  创建对话框后:

                  WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
                  lp.dimAmount = 0.0f; // Dim level. 0.0 - no dim, 1.0 - completely opaque
                  dialog.getWindow().setAttributes(lp);
                  

                  更新:您甚至可以在对话框后面添加模糊:

                  Upd: you can even add blur behind the dialog:

                  dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
                  

                  Upd2:不推荐使用模糊从 API14 开始:

                  此常量在 API 级别 14 中已弃用.
                  不再支持模糊.

                  This constant was deprecated in API level 14.
                  Blurring is no longer supported.

                  这篇关于使用 Dialog 自定义屏幕变暗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:最简单的是/否对话框片段 下一篇:如何创建将在水平维度上充满的对话框

                  相关文章

                  最新文章

                    <bdo id='M2XRx'></bdo><ul id='M2XRx'></ul>
                  <legend id='M2XRx'><style id='M2XRx'><dir id='M2XRx'><q id='M2XRx'></q></dir></style></legend>

                  <small id='M2XRx'></small><noframes id='M2XRx'>

                    <i id='M2XRx'><tr id='M2XRx'><dt id='M2XRx'><q id='M2XRx'><span id='M2XRx'><b id='M2XRx'><form id='M2XRx'><ins id='M2XRx'></ins><ul id='M2XRx'></ul><sub id='M2XRx'></sub></form><legend id='M2XRx'></legend><bdo id='M2XRx'><pre id='M2XRx'><center id='M2XRx'></center></pre></bdo></b><th id='M2XRx'></th></span></q></dt></tr></i><div id='M2XRx'><tfoot id='M2XRx'></tfoot><dl id='M2XRx'><fieldset id='M2XRx'></fieldset></dl></div>

                    1. <tfoot id='M2XRx'></tfoot>