1

Я внедрил Карты Google с нижним индексом. Однако, когда я проверяю макет, карта находится в верхней части экрана, не занимая всю ширину и высоту экрана. Я пробовал много способов исправить это, но не повезло.Вложенная прокрутка Высота Высота Выпуск

enter image description here

enter image description here

Ниже приведен код макета:

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout android:layout_height="match_parent" 
android:layout_width="match_parent" 
android:orientation="vertical" 
xmlns:android="http://schemas.android.com/apk/res/android" > 

<android.support.design.widget.CoordinatorLayout 
    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" 
    android:layout_weight="1"> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:layout_gravity="fill_vertical" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     > 
     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="fill_vertical" 
      > 
      <fragment xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:map="http://schemas.android.com/apk/res-auto" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:id="@+id/map" 
       android:layout_gravity="fill_vertical" 
       android:name="com.google.android.gms.maps.SupportMapFragment" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       tools:context="com.app.headcount.MapsActivity" 
       /> 
     </RelativeLayout> 
    </android.support.v4.widget.NestedScrollView> 


    <include layout="@layout/test" 
     android:id="@+id/design_bottom_sheet"/> 



</android.support.design.widget.CoordinatorLayout> 



</LinearLayout> 

Не могли бы вы взглянуть на это и дайте мне знать, где именно проблема? Спасибо.

+0

вы хотите, чтобы показать карту на весь экран, но не в состоянии сделать то же самое. Это ваш вопрос? –

+0

@ Vyshaks, вы используете android: layout_weight = "1" параметр вместе с android: layout_height = "match_parent". Попробуйте установить высоту в 0dp, поэтому андроид мог правильно рассчитать вес – Rafal

+0

Почему фрагмент карты внутри прокрутки? –

ответ

4

пытаются использовать андроид: fillViewport = «истинный»

Смежные вопросы