• <bdo id='0xmQt'></bdo><ul id='0xmQt'></ul>

        <tfoot id='0xmQt'></tfoot>

        <i id='0xmQt'><tr id='0xmQt'><dt id='0xmQt'><q id='0xmQt'><span id='0xmQt'><b id='0xmQt'><form id='0xmQt'><ins id='0xmQt'></ins><ul id='0xmQt'></ul><sub id='0xmQt'></sub></form><legend id='0xmQt'></legend><bdo id='0xmQt'><pre id='0xmQt'><center id='0xmQt'></center></pre></bdo></b><th id='0xmQt'></th></span></q></dt></tr></i><div id='0xmQt'><tfoot id='0xmQt'></tfoot><dl id='0xmQt'><fieldset id='0xmQt'></fieldset></dl></div>
        <legend id='0xmQt'><style id='0xmQt'><dir id='0xmQt'><q id='0xmQt'></q></dir></style></legend>
      1. <small id='0xmQt'></small><noframes id='0xmQt'>

        AppCompatActivity 作为没有标题的对话框

        时间:2023-08-31
        • <bdo id='Mu7pw'></bdo><ul id='Mu7pw'></ul>
            • <tfoot id='Mu7pw'></tfoot>
              <i id='Mu7pw'><tr id='Mu7pw'><dt id='Mu7pw'><q id='Mu7pw'><span id='Mu7pw'><b id='Mu7pw'><form id='Mu7pw'><ins id='Mu7pw'></ins><ul id='Mu7pw'></ul><sub id='Mu7pw'></sub></form><legend id='Mu7pw'></legend><bdo id='Mu7pw'><pre id='Mu7pw'><center id='Mu7pw'></center></pre></bdo></b><th id='Mu7pw'></th></span></q></dt></tr></i><div id='Mu7pw'><tfoot id='Mu7pw'></tfoot><dl id='Mu7pw'><fieldset id='Mu7pw'></fieldset></dl></div>

                <tbody id='Mu7pw'></tbody>
                  <legend id='Mu7pw'><style id='Mu7pw'><dir id='Mu7pw'><q id='Mu7pw'></q></dir></style></legend>

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

                  本文介绍了AppCompatActivity 作为没有标题的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个继承自 AppCompactActivityActivity.在活动集主题的清单中:

                  <style name="Theme.custom" parent="Theme.AppCompat.Light.Dialog"><item name="android:windowNoTitle">true</item><item name="colorPrimary">@color/primary</item><item name="colorPrimaryDark">@color/primary_dark</item><item name="colorAccent">@color/accent</item><item name="colorButtonNormal">@color/accent</item><item name="android:buttonStyle">@style/ButtonStyle</item></风格>

                  当我运行活动时,它显示为一个对话框,但显示了标题!我尝试 supportRequestWindowFeature(Window.FEATURE_NO_TITLE)RequestWindowFeature(Window.FEATURE_NO_TITLE) 但标题仍然显示.请告诉我,有什么问题?

                  <小时>

                  编辑

                  我解决了,只需将android:windowNoTitle改为windowNoTitle!因为我正在使用 AppCompactActvity!

                  解决方案

                  如果你有 AppCompatActivity 那么下面的就不行了

                  requestWindowFeature(Window.FEATURE_NO_TITLE);

                  简单的方法是在style.xml文件中设置.

                  <style name="mytheme" parent="Theme.AppCompat.Light.Dialog"><item name="windowNoTitle">true</item></风格>

                  <块引用>

                  它是 name="windowNoTitle",而不是 name="android:windowNoTitle"

                  如果您想以编程方式删除它,请在 onCreate()

                  中添加以下内容

                  getSupportActionBar().hide();

                  I have an Activity inherited from AppCompactActivity. in manifest for activity set theme:

                  <style name="Theme.custom" parent="Theme.AppCompat.Light.Dialog">
                      <item name="android:windowNoTitle">true</item>
                      <item name="colorPrimary">@color/primary</item>
                      <item name="colorPrimaryDark">@color/primary_dark</item>
                      <item name="colorAccent">@color/accent</item>
                      <item name="colorButtonNormal">@color/accent</item>
                      <item name="android:buttonStyle">@style/ButtonStyle</item>
                  </style>
                  

                  When I run activity, it shows as a dialog, but title is shown! i try supportRequestWindowFeature(Window.FEATURE_NO_TITLE) and RequestWindowFeature(Window.FEATURE_NO_TITLE) but title still displayed. Please let me know, What is wrong?


                  Edit

                  I solve it, only change android:windowNoTitle to windowNoTitle! because i am use AppCompactActvity!

                  解决方案

                  If you are having AppCompatActivity then the following won't work

                  requestWindowFeature(Window.FEATURE_NO_TITLE);

                  The simple way is to set it in the style.xml file.

                  <style name="mytheme" parent="Theme.AppCompat.Light.Dialog">
                      <item name="windowNoTitle">true</item>
                  </style>
                  

                  It is name="windowNoTitle", not name="android:windowNoTitle"

                  If you want to remove it programmatically then add the following in onCreate()

                  getSupportActionBar().hide();
                  

                  这篇关于AppCompatActivity 作为没有标题的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将字符串从对话框片段返回到活动 下一篇:全屏自定义对话框?

                  相关文章

                  最新文章

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

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

                      <bdo id='vthvR'></bdo><ul id='vthvR'></ul>
                  1. <tfoot id='vthvR'></tfoot>