在 MapView 上从左到右滑动抽屉......
我正在尝试使用以下示例在 MapView 上创建从左到右滑动抽屉:
http:// /www.anddev.org/viewtopic.php?p=16622
但它将屏幕分为两部分:上侧 MapView,第二部分显示滑动抽屉。
请建议我如何在地图上创建侧滑抽屉。
我的 result.xml 如下所示:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res/com.app.SL"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#767c9b"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:id="@+id/myGMap" android:layout_width="fill_parent"
android:enabled="true" android:clickable="true"
android:apiKey="0cgwXB2sO7JjQpz_Ho3KFg60hJSL3GjWWAC4yQA"
android:layout_height="343dp" android:layout_weight="1.26" />
<com.app.SL.Panel
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/leftPanel2"
android:layout_weight="1"
android:layout_gravity="left"
panel:position="left"
panel:openedHandle="@drawable/left_switcher_expanded_background"
panel:closedHandle="@drawable/left_switcher_collapsed_background"
>
<Button
android:id="@id/panelHandle"
android:layout_width="33dip"
android:layout_height="fill_parent"
/>
<TextView
android:id="@id/panelContent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:padding="4dip"
android:text="This is\nmy second\nleft Panel"
android:textSize="16dip"
android:textColor="#eee"
android:textStyle="bold"
android:background="#115544"
/>
</com.app.SL.Panel>
</LinearLayout>
</FrameLayout>
I am trying to create a Left to right sliding drawer over a MapView using this example :
http://www.anddev.org/viewtopic.php?p=16622
But it split the screen in two parts upper side MapView and second part displays the sliding drawer.
Please suggest me how to create a side sliding drawer over the Map..
My result.xml look like following :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res/com.app.SL"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#767c9b"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:id="@+id/myGMap" android:layout_width="fill_parent"
android:enabled="true" android:clickable="true"
android:apiKey="0cgwXB2sO7JjQpz_Ho3KFg60hJSL3GjWWAC4yQA"
android:layout_height="343dp" android:layout_weight="1.26" />
<com.app.SL.Panel
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/leftPanel2"
android:layout_weight="1"
android:layout_gravity="left"
panel:position="left"
panel:openedHandle="@drawable/left_switcher_expanded_background"
panel:closedHandle="@drawable/left_switcher_collapsed_background"
>
<Button
android:id="@id/panelHandle"
android:layout_width="33dip"
android:layout_height="fill_parent"
/>
<TextView
android:id="@id/panelContent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:padding="4dip"
android:text="This is\nmy second\nleft Panel"
android:textSize="16dip"
android:textColor="#eee"
android:textStyle="bold"
android:background="#115544"
/>
</com.app.SL.Panel>
</LinearLayout>
</FrameLayout>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
伙计试试我的代码,你就会有从左到右滑动的抽屉
Dude try my code and you will have your sliding drawer from left to right