2011-08-08 4 views
0

私はこの例を使用してのMapView上の引き出しをスライド左から右へを作成しようとしています:左.......

http://www.anddev.org/viewtopic.php?p=16622

しかし、それは、画面を分割上側の2つの部分にMapView、2番目の部分にスライドするドロワーが表示されます。

マイ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 ..しかし、私はスライディング引き出しのドラッグを開く機能を実装したい....すべての3つリンクはそれのためではありません..最初はスライド式の引き出しのように見えますが、それはすべて視認性を変えることです... –

+0

@jiyaまずレイアウトを地図が配置されている相対に変更します。 LinearLayoutの問題は、体重を置いていないことです。アンドロイド:layout_weight = "1"をmapviewに、アンドロイド:layout_weight = "0"パネルレイアウトを与えます。 – Hanry

答えて

0

男は私のコードを試してみて、あなたからあなたのスライディング引き出しを持っています右

<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>