2016-09-03 6 views
2

enter image description here「MapboXマップ」レイヤーの上にナビゲーション・メニューとドロワーを追加します。 以下に私の 'RelativeLayout'を追加しました。添付のイメージも参照してください。 マップレイヤーの上にメニューとナビゲーションドロワーを追加する方法を達成するのに役立つ人がいますか?マップ・レイヤーの左上側にナビゲーション・メニューとドロワーを追加するには

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
xmlns:mapbox="http://schemas.android.com/apk/res-auto" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
android:paddingBottom="@dimen/activity_vertical_margin" 
tools:context="com.mycompany.myfirstglapp.MainActivity"> 

<TextView 
    android:text="Hello mate!" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 

<Button android:id="@+id/locate1" 
    android:layout_width="100dp" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_alignParentBottom="true" 
    android:onClick="myButton" 
    android:text="@string/locate_me" 
    android:background="#1880c9"/> 


<com.mapbox.mapboxsdk.maps.MapView 
    android:id="@+id/mapview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    mapbox:style_url="@string/style_mapbox_streets" 
    mapbox:center_latitude="-36.91044" 
    mapbox:center_longitude="174.88203" 
    mapbox:zoom="12"/> 


</RelativeLayout> 

答えて

1

私はこれを通じて私ができる最高のあなたを歩くしようとするでしょう、アプリにナビゲーションドロワーを追加する方法を説明するそこに多くのチュートリアルがあり、あなたもアプリに含まれる1つでのAndroidプロジェクトを開始することができます。これらの理由から、私はナビゲーション・ドロワそのものを追加する方法について詳しくは触れていません。ツールバーを使用したくない場合(ほとんどのアプリはツールバーを使用します)、代わりにドロワーボタンを地図の上に表示する場合は、ImageButtonを使用し、onClickイベントを使用してイベントが発生します。相対レイアウトを使用しているため、xmlは次のようになります。

<ImageButton 
    android:id="@+id/drawer_button" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/<your button image>" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentLeft="true"/> 

ご希望の場合は、これを参考にしてください。

関連する問題