android - 半谷歌地图在片段中可见
问题描述
我的活动中有两个片段。第一个显示项目列表,第二个片段显示谷歌地图。当我点击谷歌地图选项卡时,谷歌地图是可见的,但只有一半区域。上半年地图可见,但下半年只有黑色部分。虽然它覆盖了完整的区域。当我触摸并投掷黑色区域时,我的地图也会投掷。这意味着黑色区域也是地图的一部分。
这个问题并非在所有手机中都存在。它仅在联想等少数手机中使用。我还仅在活动中检查相同的地图实现(不使用片段)并且它工作正常。
我还发现一件事,当我点击搜索框时,我的地图开始正常显示。
看看 fragment_map.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="mypackageName.MyActivity">
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="mypackage.map.googlemap.GViewModel" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/_600DP">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</layout>
解决方案
推荐阅读
- vba - 插入单元格并仅向下移动单元格
- react-native - react-native useFocusEffect "holdings" 是只读错误
- python - 在 Pygame 中 n 秒后将间隔减少 n
- powershell - iTextSharp 5 AcroFields [PowerShell] 中的“丢失”字形
- php - 添加特定月份的记录
- mysql - 更新级联上的Mysql不适用于树表
- python - 当你在不同的形状上使用 tensorflow.keras.layers.Add 会发生什么?
- ssl - 如何从 Insomnia REST Client 创建 SSL 密钥日志?
- ruby - 使用 RSpec 生成不泄漏的动态测试的最佳方法(LeakyConstantDeclaration 问题)?
- npm - React-snap 无法抓取 pdf 文件?