久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

      2. 主題不適用于 Android 上的 DialogFragment

        Theme not applying to DialogFragment on Android(主題不適用于 Android 上的 DialogFragment)

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

                <tbody id='LsRtZ'></tbody>

              <legend id='LsRtZ'><style id='LsRtZ'><dir id='LsRtZ'><q id='LsRtZ'></q></dir></style></legend>
              1. <small id='LsRtZ'></small><noframes id='LsRtZ'>

                <tfoot id='LsRtZ'></tfoot>
                • 本文介紹了主題不適用于 Android 上的 DialogFragment的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在將舊 Dialogs 切換為 DialogFragment,但主題和樣式似乎不起作用.

                  I'm switching my old Dialogs to DialogFragment, but the themes and styles don't seem to be working.

                  我正在使用兼容庫 v4 中的 DialogFragment,并且在 onCreate 方法中我嘗試調用 setStyle(style, theme);有很多不同的主題,但對話框總是在運行 Android 4.0.3 的模擬器中顯示為舊"對話框(即,它不顯示在 Holo 主題中).

                  I'm using the DialogFragment from the compatibility library v4, and in the onCreate method I've tried calling setStyle(style, theme); with a lot of different themes, but the dialog always shows as an "old" dialog in the emulator running Android 4.0.3 (i.e., it does not shows in Holo theme).

                  還有什么我應該做的嗎?使用兼容性庫是否會禁用 Holo 主題或任何東西?如果是這種情況,我是否應該創建兩個 DialogFragment,一個用于舊版本,一個用于新版本?

                  Is there anything else that I should be doing? Does using the compatibility library disables the Holo theme or anything? If this is the case, should I create two DialogFragments, one for older versions and one for newer versions?

                  謝謝!

                  這是我的對話框的(簡化的)代碼.我已經嘗試過 Theme_Holo_Dialog_NoActionBar 和 Theme_DeviceDefault_Dialog_NoActionBar,但 Android 4 模擬器總是將對話框顯示為舊"對話框,而不是使用 Holo 主題.我究竟做錯了什么?:(

                  Here's the (simplified) code for my dialog. I've tried both Theme_Holo_Dialog_NoActionBar and Theme_DeviceDefault_Dialog_NoActionBar, but the Android 4 emulator always shows the dialog as an "old" dialog instead of using the Holo theme. What am I doing wrong? :(

                  [...]
                  import android.support.v4.app.DialogFragment;
                  [...]
                  
                  public class AlertDialogFragment extends DialogFragment {
                  
                    public static AlertDialogFragment newInstance(int id) {
                  
                      AlertDialogFragment f = new AlertDialogFragment();
                      Bundle args = new Bundle();
                      args.putInt("id", id);
                      f.setArguments(args);
                  
                   }
                  
                    @Override
                    public void onCreate(Bundle savedInstanceState) {
                      super.onCreate(savedInstanceState);
                      int style = DialogFragment.STYLE_NORMAL, theme = 0;
                      theme = android.R.style.Theme_Holo_Dialog_NoActionBar;
                      setStyle(style, theme);     
                    }
                  
                    @Override
                    public Dialog onCreateDialog(Bundle savedInstanceState) {
                  
                      mId = getArguments().getInt("id");
                      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
                          .setTitle(mTitle)
                          .setMessage(mMessage)
                          .setPositiveButton(getString(R.string.btn_ok), new DialogInterface.OnClickListener() {      
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  dismiss();                  
                              }
                          });
                          return builder.create();
                      }
                  

                  推薦答案

                  我相信你需要在實際的Dialog而不是Fragment上設置主題

                  I believe you need to set the theme on the actual Dialog and not the Fragment

                  使用此構造函數創建您的 AlertDialog:

                  Use this constructor to create your AlertDialog:

                   AlertDialog.Builder(Context context, int theme)
                  

                   AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), theme)
                  

                  這篇關于主題不適用于 Android 上的 DialogFragment的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

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

                    <legend id='l8M1s'><style id='l8M1s'><dir id='l8M1s'><q id='l8M1s'></q></dir></style></legend>

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

                            <tbody id='l8M1s'></tbody>

                          • <bdo id='l8M1s'></bdo><ul id='l8M1s'></ul>
                          • 主站蜘蛛池模板: 亚洲一区二区三区国产 | 呦呦在线视频 | 91欧美| 日韩精品欧美精品 | 久久高清 | 成人免费视频在线观看 | 国产视频1区2区 | 日韩欧美中文字幕在线观看 | 日韩精品999 | 日韩一区二区在线观看视频 | 国产精品免费小视频 | 午夜在线精品 | 希岛爱理在线 | 亚洲视频中文字幕 | 国产成人福利在线 | 精品蜜桃一区二区三区 | 亚洲精品成人av久久 | 国产91视频一区二区 | 欧美日韩亚洲一区 | 国产一区不卡 | 国产成人jvid在线播放 | 国产欧美日韩在线 | 久久亚洲一区二区三区四区 | 精品一区二区三区日本 | 欧美黄色片 | 日本人和亚洲人zjzjhd | 亚洲成人播放器 | 黑人一级片视频 | 久久久久国产精品一区 | 激情五月婷婷在线 | 国产小u女发育末成年 | 免费观看一级毛片视频 | 亚洲一区二区电影网 | 国产一区二区三区视频 | 99在线资源 | 久久伊人精品一区二区三区 | 一区二区在线免费观看 | 曰韩一二三区 | 可以免费观看的av片 | www.久久久 | 91免费在线|