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

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

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

        android蜂窝中的弹出/覆盖屏幕

        时间:2024-04-14
          • <bdo id='pbO4m'></bdo><ul id='pbO4m'></ul>
                <tbody id='pbO4m'></tbody>

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

              <tfoot id='pbO4m'></tfoot>

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

                1. <i id='pbO4m'><tr id='pbO4m'><dt id='pbO4m'><q id='pbO4m'><span id='pbO4m'><b id='pbO4m'><form id='pbO4m'><ins id='pbO4m'></ins><ul id='pbO4m'></ul><sub id='pbO4m'></sub></form><legend id='pbO4m'></legend><bdo id='pbO4m'><pre id='pbO4m'><center id='pbO4m'></center></pre></bdo></b><th id='pbO4m'></th></span></q></dt></tr></i><div id='pbO4m'><tfoot id='pbO4m'></tfoot><dl id='pbO4m'><fieldset id='pbO4m'></fieldset></dl></div>
                  本文介绍了android蜂窝中的弹出/覆盖屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在 android 地图应用程序(下图)中实现类似 Places 的弹出/覆盖屏幕(我更感兴趣的是如何将该屏幕放置在屏幕的右侧/左侧).我可以创建一个活动并使用对话框主题,这主要解决了我的问题,但它位于屏幕的中心.有人有更好的想法,我如何创建一个弹出/覆盖屏幕,例如非地图应用程序中的位置并放置在屏幕的顶部/右侧?我猜他们是通过地图叠加来做到的.

                  I would like to achieve a popup/overlay screen like Places (i`m more interested how can i place that screen for example in the right/left side of the screen ) in the android maps application (image below). I can create an activity and use the Dialog theme, this mostly resolve my problem, but it placed center in the screen. Somebody have any better idea how i can create a popup/overlay screen like the places in a non-map application and place to top/right of the screen ?. My guess they did it with map overlays.

                  推荐答案

                  好吧,这就是我所做的...我使用 FrameLayout 覆盖了一个 LinearLayout,我可以在其中填充一个 View.这是我的代码的摘录:

                  well, here's what I did... I used a FrameLayout to overlay a LinearLayout where I can fill it with a View. Here's an excerpt of my code:

                  XML:

                  <FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_weight="1">
                  
                       <fragment class="com.some.location.to.fragment"
                            android:id="@+id/fragment"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent" />
                  
                       <LinearLayout
                            android:id="@+id/overlay_pane"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:visibility="gone"
                            android:background="@color/transparent">
                  
                        </LinearLayout>
                  
                  </FrameLayout>
                  

                  然后在我的某个按钮上的代码中,我只需将一个视图(在您的情况下,它可以只是对话框的内容)添加到 overlay_pane 线性布局.

                  Then in my code on some button, I would just add a View (in your case it can just be the dialog's contents) to the overlay_pane LinearLayout.

                  Java 示例:

                  ViewGroup container = findViewById(R.id.overlay_pane);
                  container.setVisibility(View.VISIBLE);
                  container.addView(some_view_you_inflated);
                  

                  但是这个膨胀的视图将具有以下背景:@drawable/dialog_full_holo_light 用于像蜂窝样式这样的漂亮边框效果.

                  But this inflated view would have the following background: @drawable/dialog_full_holo_light for a nice border effect like the Honeycomb style.

                  您可以在您的 SDK 中的以下文件夹中找到背景可绘制对象

                  You can find the background drawable in your SDK in the following folder

                  your_SDK_dir/platforms/android-12/data/res/drawable-hdpi/dialog_full_holo_light.9.png

                  your_SDK_dir/platforms/android-12/data/res/drawable-hdpi/dialog_full_holo_light.9.png

                  所以只要把它复制到你的drawables中.

                  So just copy that into your drawables.

                  注意:您也可以使用 dialog_full_holo_dark 或任何自定义背景来获得相同的效果.

                  Note: that you can also use the dialog_full_holo_dark or any custom background for the same effect.

                  希望对您有所帮助 :) 如果我不清楚,请告诉我

                  I hope that helps :) Let me know if I was unclear at any point

                  注意:您可以仅使用带有 match_parent 的 LinearLayout,而不是使用片段,同时为 layout_width 和 layout_height.然后你会用背景"用户界面填充那个 LinearLayout(在问题的例子中..那将是地图)

                  Note: Instead of using a fragment, you could merely use a LinearLayout with match_parent for both layout_width and layout_height. And then you would fill that LinearLayout with the "background" UI (in the question's example.. that would be the map)

                  这篇关于android蜂窝中的弹出/覆盖屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:弹出 UIViewController 下一篇:如何在android中像没有微调器的微调器一样弹出列表?

                  相关文章

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

                        <bdo id='pFBQw'></bdo><ul id='pFBQw'></ul>

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