左向右滑动抽屉在MapView的.......

问题描述:

我想创建一个自左向右用这个例子滑动抽屉在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> 
+0

可以绘制从[这里]滑动抽屉(http://blog.sptechnolab.com/2011/02/10/android/android-sliding-drawer/)你可以看看[这里](http://blog.pocketjourney.com/2008/03/15/tutorial-1-transparent-panel-linear-layout-on-mapview-google-map/)以获取更多信息可以尝试[这](http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html) – Hanry

+0

谢谢hanry ..但我想实现滑动抽屉拖动打开功能....所有三个链接不是那个..首先是看起来像滑动抽屉,但是..所有关于改变可见性... –

+0

@jiya第一件事改变你的布局为相对在哪个地图放置。 LinearLayout的问题是您忘记放置重量。将android:layout_weight =“1”赋予mapview和android:layout_weight =“0”面板布局。 – Hanry

多德尝试我的代码,你将不得不从你的滑动抽屉在此之前,从左至右

<SlidingDrawer 
    android:id="@+id/drawer" 
    android:layout_width="300dp" 
    android:layout_height="match_parent" 
    android:content="@+id/content" 
    android:handle="@+id/handle" 
    android:orientation="horizontal" 
    android:rotation="180" > 

    <Button 
     android:id="@+id/handle" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" /> 

    <LinearLayout 
     android:id="@+id/content" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" > 
    </LinearLayout> 
</SlidingDrawer> 

</LinearLayout>