2014-09-24 77 views
0

我希望把與谷歌地圖裏面的按鈕佈局與漸變背景在此應用中的按鈕:佈局與谷歌地圖

enter image description here

我已經做了很多組合,但他們沒有工作。我如何才能做到這一點?

回答

1

它只是把相對佈局內的地圖和按鈕,它爲我的作品

<RelativeLayout 
    android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@android:color/transparent"> 
<com.google.android.gms.maps.MapView 
    android:id="@+id/map" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@+id/textView_for_welcome" 
    android:apiKey="@string/live_key_for_map" 
    android:clickable="true" > 
</com.google.android.gms.maps.MapView> 
    <LinerLayout 
    android:id="@+id/textView_for_welcome" 
    android:layout_width="fill_parent" 
    android:layout_height="80dp" 

    android:background="@drawable/backgroud_layout" 
    android:gravity="center" 
    > 
     ----inside put all ur Views ---- 
</LinerLayout> 
     </RelativeLayout> 

也使用按鈕漸變背景(或任何佈局)U想要的,但重要的是ü必須指定下一個映射

您可以使用backgroud_layout.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
<gradient 
    android:startColor="#AA474946" 
    android:endColor="#FFFFFFFF" 
    android:angle="270"/> 
<corners android:radius="5dp" /> 
</shape> 

來繪製文件夾 使用FF-FF阿爾法紅FF-FF藍,綠

+0

我在哪裏放置按鈕佈局的漸變背景? – user4152 2014-09-24 10:50:04

+0

android:background =「#AAFF4a4a」 – SelvaMariappan 2014-09-24 11:19:26

+0

請檢查我最遲的答案 – SelvaMariappan 2014-09-24 11:41:40