2011-08-08 1 views
0

왼쪽 .......지도보기 서랍 슬라이딩 오른쪽으로 :내가이 예를 사용하여지도보기를 통해 서랍 슬라이딩 오른쪽으로 왼쪽을 만들기 위해 노력하고

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

을하지만 화면을 분할 상단의 두 부분 MapView 및 두 번째 부분은 슬라이딩 서랍을 표시합니다.

<?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/) 왼쪽 당신은 더 많은 것을 위해 [here] (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의 문제점은 무게를 놓는 것을 잊었다는 것입니다. android : layout_weight = "1"을 mapview에, android : layout_weight = "0"패널 레이아웃을 지정하십시오. – Hanry

답변

0

야 내 코드를 시도하고 다음에서 슬라이딩 서랍을해야합니다 :

내 result.xml 모양 다음과 같이 .. 어떻게지도 서랍 슬라이딩면을 작성하는 날을 제안하십시오 그 직전

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