• <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蜂窝中的弹出/覆盖屏幕

        Popup/Overlay screen in android honeycomb(android蜂窝中的弹出/覆盖屏幕)
          • <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蜂窝中的弹出/覆盖屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                  SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                  Android file copy(安卓文件拷贝)
                  Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                  Android copy image from gallery folder onto SD Card alternative folder(Android将图像从图库文件夹复制到SD卡替代文件夹)
                  Is there a tool to find unused resources in an Android project?(是否有工具可以在 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>
                      • <tfoot id='pFBQw'></tfoot>

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

                              <tbody id='pFBQw'></tbody>
                            <legend id='pFBQw'><style id='pFBQw'><dir id='pFBQw'><q id='pFBQw'></q></dir></style></legend>
                          • <small id='pFBQw'></small><noframes id='pFBQw'>