簡體   English   中英

如何在mapview上添加textview

[英]how to add a textview on mapview

我想實現這樣的目標

這是我的代碼。 所以我在mapview上使用textview但我想要textview周圍的透明背景..它應該看起來像在mapview上浮動

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="7"
    android:orientation="vertical"
    android:weightSum="10">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="9"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:id="@+id/location_search"
        android:drawableRight="@drawable/ic_search"
        android:text="Search" />

    <com.google.android.gms.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:apiKey="AIzaSyD_UZKqkkSN9jQBb9vRk6P4Dz6KCTSUwzU">

    </com.google.android.gms.maps.MapView>


</LinearLayout>

嘗試這個

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
        <TextView
            android:id="@+id/MyTextView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello"
            android:layout_alignParentBottom="true" />


        <com.google.android.maps.MapView
            android:id="@+id/map"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:apiKey="Your api key"
            android:enabled="true"
            android:clickable="true"
            android:layout_above="@+id/MyTextView"" />
 </RelativeLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM