Friday, 15 May 2015

how to use maps and slider drawer in same xml for android activity -



how to use maps and slider drawer in same xml for android activity -

so situation want show google map on main page along slider drawer opens on slide left right. able accomplish same using below xml.

so, problem when drawer not opened, not able communicate maps i.e. on touch not able move map or utilize zoom functio. however, drawer working , there no runtime error.

xml used

<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"> <!-- <fragment android:id="@+id/badmap" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment" /> --> <com.google.android.gms.maps.mapview android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- framelayout display fragments --> <framelayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- listview display slider menu --> <listview android:id="@+id/list_slidermenu" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:choicemode="singlechoice" android:divider="@color/list_divider" android:dividerheight="1dp" android:listselector="@drawable/list_selector" android:background="@color/list_background"/>

ideas on how create google maps touchable?

try this:

... <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- framelayout display fragments --> <framelayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" > <com.google.android.gms.maps.mapview android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </framelayout> ....

android xml google-maps android-layout

No comments:

Post a Comment