【发布时间】:2019-01-07 05:17:04
【问题描述】:
我的屏幕顶部有一个自动完成 Google 搜索,下方有一个 Google 地图,底部有一个浮动操作按钮。
当我尝试在底部的谷歌地图上添加一个浮动操作按钮时,该按钮在屏幕上不可见。
这是我的 activity_maps.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MapsActivity"
android:orientation="vertical"
android:weightSum="1">
<fragment
android:id="@+id/place_autocomplete"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_width="match_parent"
android:layout_height="55dp"
/>
<fragment
android:id="@+id/map"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<android.support.design.widget.CoordinatorLayout
android:layout_width="wrap_content"
android:layout_height="35dp">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginRight="8dp"
android:layout_marginBottom="112dp"
android:src="@android:drawable/ic_menu_search"/>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
【问题讨论】:
-
你有多少个xml文件?
-
只有这一个文件。
-
所以你的java文件膨胀了这个?
标签: android google-maps android-studio autocomplete floating-action-button