【发布时间】:2018-09-15 23:14:47
【问题描述】:
在 iOS 中,这很容易。
不过,在 Android 中,我尝试通过 android:paddingBottom=80dp" 中的 xml 以及 mapView.setPadding(0,0,0,80) 中的编程方式在地图底部添加填充。在这两种情况下,地图都会向上移动,就像它被切割并出现空白区域一样,实际上只有 Google 徽标应该向上移动,而地图应该保持全高。
这是我的 xml:
<com.google.android.gms.maps.MapView
android:id="@+id/mapView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
因此,mapView 以全高继续,但由于填充,Google 地图的地图向上移动。有没有办法在 Google Maps 的地图保持不变的情况下只上移 Google 徽标?
【问题讨论】:
标签: java android google-maps google-maps-api-3