2017-01-14 3 views
0

Ниже мой XML макет:Google Maps обрезается в моем макете

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fillViewport="true"> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="200dp" 
     android:background="#ffffff" 
     android:id="@+id/promotion_image" 
     android:scaleType="fitXY"/> 
    <View 
     android:id="@+id/grayline" 
     android:layout_width="match_parent" 
     android:layout_height="1dp" 
     android:background="@android:color/darker_gray" 
     android:layout_below="@+id/promotion_image"/> 
    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceMedium" 
     android:text="company name" 
     android:id="@+id/company_name" 
     android:layout_below="@id/grayline" 
     android:typeface="monospace" 
     android:textSize="20sp" 
     android:textColor="#000000" 
     android:padding="10dp" 
     android:background="#ffffff"/> 
    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceMedium" 
     android:text="Title" 
     android:id="@+id/title" 
     android:layout_below="@id/company_name" 
     android:typeface="monospace" 
     android:textSize="15sp" 
     android:textColor="#000000" 

     android:padding="10dp" 
     android:background="@drawable/rounded_corner"/> 
    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:text="Description" 
     android:id="@+id/sales_description" 
     android:layout_below="@id/title" 
     android:textSize="10sp" 
     android:textColor="#000000" 
     android:padding="10dp" 
     android:background="#ffffff"/> 
    <View 
     android:id="@+id/grayline2" 
     android:layout_width="match_parent" 
     android:layout_height="1dp" 
     android:background="#d3d3d3" 
     android:layout_below="@+id/sales_description"/> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:text="Small Text" 
     android:id="@+id/promotional_period" 
     android:layout_below="@id/grayline2" 
     android:textSize="15sp" 
     android:textColor="#000000" 
     android:background="#ffffff" 
     android:padding="10dp" 
     android:layout_marginBottom="10dp" 
     android:drawableLeft="@drawable/blue_clock" 
     android:drawablePadding="10dp" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:text="Location" 
     android:id="@+id/locationText" 
     android:layout_below="@id/promotional_period" 
     android:textStyle="bold" 
     android:textSize="15sp" 
     android:textColor="#000000" 
     android:padding="10dp" 
     android:background="#ffffff" 
     android:drawableLeft="@drawable/blue_map_marker" 
     android:drawablePadding="10dp"/> 
    <View 
     android:id="@+id/grayline3" 
     android:layout_width="match_parent" 
     android:layout_height="1dp" 
     android:background="#d3d3d3" 
     android:layout_below="@+id/locationText"/> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:id="@+id/sales_location" 
     android:layout_below="@id/grayline3" 
     android:textSize="15sp" 
     android:textColor="#000000" 
     android:padding="10dp" 
     android:background="#ffffff"/> 
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/map_framecontainer" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:layout_below="@id/sales_location"> 

     <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:name="com.google.android.gms.maps.SupportMapFragment" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      tools:context="com.example.user.mycouponcodes.RetrieveIndividualWarehouseSales" 
      map:cameraZoom="10"/> 
     </FrameLayout> 



</RelativeLayout> 
    </ScrollView> 

Все работает отлично, за исключением того, что Карты Google получили обрезаны, как показано ниже: Screenshot here

Как я могу сделать карты Google размер больше? Даже если я удалил FrameLayout, он также показал тот же результат.

ответ

0

решаемые его жестко прописывать высоту

android:layout_height="200dp" 

Не уверен, если это обычная практика, чтобы сделать это таким образом, но это работает.

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