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

    1. <legend id='STo6a'><style id='STo6a'><dir id='STo6a'><q id='STo6a'></q></dir></style></legend>
    2. <tfoot id='STo6a'></tfoot>
    3. <small id='STo6a'></small><noframes id='STo6a'>

    4. <i id='STo6a'><tr id='STo6a'><dt id='STo6a'><q id='STo6a'><span id='STo6a'><b id='STo6a'><form id='STo6a'><ins id='STo6a'></ins><ul id='STo6a'></ul><sub id='STo6a'></sub></form><legend id='STo6a'></legend><bdo id='STo6a'><pre id='STo6a'><center id='STo6a'></center></pre></bdo></b><th id='STo6a'></th></span></q></dt></tr></i><div id='STo6a'><tfoot id='STo6a'></tfoot><dl id='STo6a'><fieldset id='STo6a'></fieldset></dl></div>
    5. MapView 在对话框中显示较暗的地图

      时间:2023-08-30

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

            <tbody id='dimqh'></tbody>

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

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

              • <bdo id='dimqh'></bdo><ul id='dimqh'></ul>
              • 本文介绍了MapView 在对话框中显示较暗的地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在尝试在对话窗口中显示谷歌地图.对于此对话框,我使用以下代码行:

                I am trying to display google map inside dialog window. For this dialog i am using following lines of code:

                final Dialog dialog = new Dialog(SetProfileOnlineActivity.this);
                        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                        dialog.setCanceledOnTouchOutside(false);
                        dialog.setCancelable(false);
                        dialog.setContentView(R.layout.pick_location_layout);
                        Window w = dialog.getWindow();
                        w.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
                        dialog.show();
                

                pick_location_layout.xml

                <?xml version="1.0" encoding="utf-8"?>
                <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    xmlns:tools="http://schemas.android.com/tools"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
                
                
                    <com.google.android.gms.maps.MapView
                        android:id="@+id/mapview"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        app:layout_constraintBottom_toTopOf="@+id/myLl"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        />
                
                    <LinearLayout
                        android:id="@+id/ll_map_search"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        android:layout_marginEnd="8dp"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:background="@color/white"
                        android:orientation="horizontal"
                        >
                        <EditText
                            android:id="@+id/et_search_text"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:hint="Search"
                            android:padding="8dp"
                            android:layout_weight="1"
                            android:textColor="@color/black"
                            android:textSize="18sp"
                            android:maxLines="1"
                            android:background="@android:color/transparent"
                             />
                        <ImageButton
                            android:id="@+id/ib_search_map"
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:scaleType="fitCenter"
                            android:src="@drawable/search"
                            />
                    </LinearLayout>
                
                    <LinearLayout
                        android:id="@+id/myLl"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:layout_constraintBottom_toBottomOf="parent">
                
                        <Button
                            android:id="@+id/btn_map_cancel"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:background="@color/red"
                            android:text="Cancel"
                            android:textColor="@color/white"
                            android:textSize="@dimen/_18sdp" />
                
                        <Button
                            android:id="@+id/btn_map_ok"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:background="@color/green"
                            android:text="Ok"
                            android:textColor="@color/white"
                            android:textSize="@dimen/_18sdp" />
                    </LinearLayout>
                
                    <Button
                        android:id="@+id/btn_switch_view"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="8dp"
                        android:layout_marginEnd="8dp"
                        android:layout_marginStart="8dp"
                        android:text="Switch View"
                        app:layout_constraintBottom_toTopOf="@+id/myLl"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent" />
                
                
                </android.support.constraint.ConstraintLayout>
                

                现在我的问题是我的地图显示得更暗了.我还在对话框中显示编辑文本,该对话框显示完美,但地图只是显示较暗的组件,如图所示.那么,有什么办法可以让 mapview 和其他组件一样亮吗?

                Now my problem is that my map is showing darker. I am also displaying edittext in dialog which is showing perfectly but map is only component which is showing darker as shown in image. So, is there any way to make mapview brighter as other components?

                推荐答案

                MapView 更新

                dialogmapView 的解决方案是像这样删除背景暗淡(针对您的代码进行了调整,只需粘贴在 dialog.show() 之前):

                Solution for mapView in dialog is removing background dim like this (adjusted for your code, just paste before dialog.show()):

                        w.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
                

                不好的是我在 5 中找到了这个解决方案岁的问题

                上一个答案

                我刚刚检查了新地图"解决方案(在这里阅读更多):

                I've just checked with "newer map" solution (read more here):

                <fragment
                    android:id="@+id/map"
                    android:name="com.google.android.gms.maps.SupportMapFragment"
                    app:mapType="normal"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
                

                它显示明亮--图像在这里--

                这篇关于MapView 在对话框中显示较暗的地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何使用 setOnPreferenceChangeListener 进行 QuietlyCodi 下一篇:在 Android App 中的应用程序启动时仅显示一次版本

                相关文章

                最新文章

                  1. <tfoot id='xVmez'></tfoot>
                      <bdo id='xVmez'></bdo><ul id='xVmez'></ul>
                  2. <small id='xVmez'></small><noframes id='xVmez'>

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

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