2016-08-17 3 views
1

TextView을 내 안드로이드 애플리케이션에 GoogleMap에 올려 놓으려고합니다. 지금까지 쓴 다음 코드를 참조하십시오. 실행하면 TextViewGoogleMap에 표시되지 않습니다.구글 맵 안드로이드에 텍스트 뷰를 보여줍니다.

<RelativeLayout 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" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context=".activity.HomeActivity" 
    tools:showIn="@layout/app_bar_main"> 

    <LinearLayout 
     android:id="@+id/validity" 
     android:layout_width="match_parent" 
     android:layout_height="50dp" 
     android:orientation="vertical" 
     android:layout_alignParentBottom="true"> 
     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="You are not a paid user."/> 
    </LinearLayout> 

    <fragment 
     android:id="@+id/home_map" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="false" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentBottom="true" /> 

</RelativeLayout> 

이 문제를 해결하려면 가능한 해결책을 제안하십시오.

+0

대답을 얻었습니까? – DKV

+0

답변을 얻었습니까? – Rahul

답변

3

사용 FrameLayout이 대신 상대 레이아웃. 나는 이것을 테스트했고 이것은 작동 중임

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 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" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 
    <fragment 
     android:id="@+id/home_map" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentLeft="false" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentBottom="true" /> 
    <LinearLayout 
     android:id="@+id/validity" 
     android:layout_width="match_parent" 
     android:layout_height="50dp" 
     android:orientation="vertical" 
     android:layout_gravity="bottom" 
     android:background="@android:color/white"> 
     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="You are not a paid user." 
      /> 
    </LinearLayout> 



</FrameLayout> 
+0

예. 감사합니다 – anuradha

+0

@ Vivek Mishra upvoted – anuradha

2

사용과 같이이 코드

<fragment 
    android:id="@+id/home_map" 
    android:name="com.google.android.gms.maps.SupportMapFragment" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="false" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentBottom="true" /> 
<LinearLayout 
    android:id="@+id/validity" 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:orientation="vertical" 
    android:layout_alignParentBottom="true"> 
    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="You are not a paid user."/> 
</LinearLayout>