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

  • <tfoot id='XMs1q'></tfoot>
      <bdo id='XMs1q'></bdo><ul id='XMs1q'></ul>

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

      1. 在活動之上創建一個透明對話框

        Create a transparent dialog on top of activity(在活動之上創建一個透明對話框)

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

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

                  <tfoot id='xag9C'></tfoot>
                    <tbody id='xag9C'></tbody>
                1. <legend id='xag9C'><style id='xag9C'><dir id='xag9C'><q id='xag9C'></q></dir></style></legend>
                  本文介紹了在活動之上創建一個透明對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在當前活動的頂部放置一個圖層,該圖層可以解釋當前屏幕上發生的情況,類似于 contact+ 應用程序 .

                  I'm trying to put a layer on top of the current activity which would have explanation of what is going on on the current screen, similar to what occurs on contact+ app .

                  我知道有一些解決方案(例如 showCase 庫 和 superToolTips 庫),我也知道我可以創建一個視圖并通過將其添加到活動的窗口將其設置在頂部,但我需要將整個對話框層放在頂部.

                  I know there are some solutions for this (like the showCase library and the superToolTips library ) , and I also know that I can create a view and set it on top by adding it to the window of the activity , but I need put a whole dialog layer on top.

                  無論我嘗試什么,每個解決方案都無法按照我需要的方式工作.

                  No matter what I try, each solution doesn't work the way I need it to work.

                  簡而言之,我需要的是:

                  in short , what I need is:

                  • 全屏對話框.

                  • full screen dialog.

                  操作欄、通知欄和后面活動的內容沒有變化(不是視覺上的,也不是邏輯上的),這意味著對話框后面的所有內容都與顯示對話框之前顯示的內容保持一致.

                  no change (not visual and not logical) to the action bar, notification bar, and content of the activity behind, meaning that everything behind the dialog stays the same it was shown a moment before the dialog was shown.

                  除了我用于對話框的視圖外,應該是透明的,應該正常顯示.

                  be transparent except for the views I use for the dialog, which should be shown normally.

                  可悲的是,我總是只得到我需要的一部分.

                  Sadly, I've always got only a part of the things I needed.

                  這是我的代碼:

                  styles.xml:

                  styles.xml:

                  <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>
                  

                  MainActivity.java:

                  MainActivity.java:

                  ...
                  final Dialog dialog = new Dialog(this, R.style.full_screen_dialog);
                  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                  dialog.setContentView(R.layout.floating_tutorial);
                  dialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
                  dialog.getWindow().setFormat(PixelFormat.TRANSLUCENT);
                  dialog.show();
                  

                  這段代碼會將布局放在活動的頂部,但遺憾的是它沒有任何透明度,即使我已經設置了它.我使用的布局非常簡單,所以我不發布它.

                  This code will put the layout on top of the activity, but sadly it doesn't have any transparency , even though I've set it . The layout I've used is very simple which is why I don't post it.

                  我錯過了什么?應該怎么做才能修復代碼?

                  what am I missing ? what should be done to fix the code?

                  如何使對話框既透明、全屏又不會更改操作欄和通知欄.

                  how can I make the dialog both transparent, full screen AND that it won't change the action bar and notifications bar.

                  找到一個好的解決方案后,這里是工作代碼:

                  after finding a good solution, here's the working code:

                  @Override
                  protected void onCreate(final Bundle savedInstanceState) {
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.activity_main);
                      final Dialog dialog = new Dialog(this);
                      dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                      dialog.setContentView(R.layout.floating_tutorial);
                      final Window window = dialog.getWindow();
                      window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
                      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
                      window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
                      dialog.show();
                  }
                  

                  推薦答案

                  只需更改 Dialog 的背景顏色即可:

                  Just change the background color of your Dialog:

                  dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
                  

                  這可以防止暗淡效果:

                  dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
                  

                  這篇關于在活動之上創建一個透明對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                  <tfoot id='aPBZI'></tfoot>
                    <bdo id='aPBZI'></bdo><ul id='aPBZI'></ul>

                    1. <small id='aPBZI'></small><noframes id='aPBZI'>

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

                              <tbody id='aPBZI'></tbody>

                            主站蜘蛛池模板: 中文字幕国产一区 | 成人网视频| 亚洲国产精品久久久 | 成人精品一区二区三区 | 91人人视频在线观看 | 免费看的黄网站 | 亚洲精品视频一区二区三区 | 精品国产一区二区三区久久久久久 | 视频1区| www.午夜| 国产精品99久久久久久动医院 | 男人亚洲天堂 | 亚洲国产成人精品久久 | 日韩免费福利视频 | 免费国产视频在线观看 | 欧美成人第一页 | 91污在线 | 久久精品国产亚洲a | 欧美日韩不卡合集视频 | julia中文字幕久久一区二区 | 午夜影院 | 亚洲国产欧美精品 | 精品国产乱码久久久久久蜜退臀 | 成人国产精品久久久 | 国产精品欧美一区二区三区 | www.jizzjizz| 粉嫩av| 欧美成人在线影院 | 东京久久| 在线看免费的a | 超碰婷婷 | 中文字幕日韩一区 | 二区在线观看 | 亚洲一区二区不卡在线观看 | 六月婷婷久久 | 亚洲精品99 | 午夜av影院| 欧美在线小视频 | 亚洲欧美综合精品久久成人 | 91看片网| 欧美日韩在线视频一区 |