• <tfoot id='PJux0'></tfoot>
    <legend id='PJux0'><style id='PJux0'><dir id='PJux0'><q id='PJux0'></q></dir></style></legend>

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

        • <bdo id='PJux0'></bdo><ul id='PJux0'></ul>

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

      2. Android 上的自定义对话框:如何将其标题居中?

        时间:2023-05-18
        <tfoot id='4tix8'></tfoot>
          <bdo id='4tix8'></bdo><ul id='4tix8'></ul>
            <i id='4tix8'><tr id='4tix8'><dt id='4tix8'><q id='4tix8'><span id='4tix8'><b id='4tix8'><form id='4tix8'><ins id='4tix8'></ins><ul id='4tix8'></ul><sub id='4tix8'></sub></form><legend id='4tix8'></legend><bdo id='4tix8'><pre id='4tix8'><center id='4tix8'></center></pre></bdo></b><th id='4tix8'></th></span></q></dt></tr></i><div id='4tix8'><tfoot id='4tix8'></tfoot><dl id='4tix8'><fieldset id='4tix8'></fieldset></dl></div>
                  <tbody id='4tix8'></tbody>

                <legend id='4tix8'><style id='4tix8'><dir id='4tix8'><q id='4tix8'></q></dir></style></legend>

                  <small id='4tix8'></small><noframes id='4tix8'>

                • 本文介绍了Android 上的自定义对话框:如何将其标题居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在开发一个 Android 应用程序.

                  I'm developing an Android application.

                  如何将我正在使用的自定义对话框的标题居中?

                  How can I center the title for a custom dialog that I'm using?

                  推荐答案

                  刚刚发现这篇文章,同时试图弄清楚如何做同样的事情.以下是我为将来发现此问题的其他人所做的.

                  Just found this post while trying to figure out how to do the same thing. Here's how I did it for anyone else that finds this in the future.

                  样式xml如下:

                      <?xml version="1.0" encoding="utf-8"?>
                      <resources>
                          <style name="PauseDialog" parent="@android:style/Theme.Dialog">
                              <item name="android:windowTitleStyle">@style/PauseDialogTitle</item>
                          </style>
                  
                          <style name="PauseDialogTitle" parent="@android:style/TextAppearance.DialogWindowTitle">
                              <item name="android:gravity">center_horizontal</item>
                          </style>
                          <style name="DialogWindowTitle">
                          <item name="android:maxLines">1</item>
                          <item name="android:scrollHorizontally">true</item>
                          <item name="android:textAppearance">@android:style/TextAppearance.DialogWindowTitle</item>
                          </style>
                      </resources>
                  

                  在我想要设置样式的对话框的 onCreateDialog 方法的活动中,我创建了这样的对话框:

                  And in my activities onCreateDialog method for the dialog I want styled I create the dialog like this:

                  Dialog pauseDialog = new Dialog(this, R.style.PauseDialog);
                  pauseDialog.setTitle(R.string.pause_menu_label);
                  pauseDialog.setContentView(R.layout.pause_menu);
                  

                  这篇关于Android 上的自定义对话框:如何将其标题居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 iPhone iOS/Safari 上显示 HTML 输入类型编号的缺陷 下一篇:基于故事板的登录屏幕示例

                  相关文章

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

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