2014-02-14 2 views
1

슬라이딩 창에 MapFragment가있는 앱을 만들려고합니다. 지도는 주요 콘텐츠 인 ListView에 열려있는 조각에 있습니다. 그러나 MapFragment가 항상 숨겨 지도록 설정할 수는 없습니다. 기본보기에 표시되는 부분이 항상 있기 때문입니다. 다음은 내 코드 SlidingPaneLayout의 본질이다SlidingPaneLayout을 보이지 않게 설정할 수 없습니다.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:id="@+id/LinearLayout1" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:orientation="vertical" 
       tools:context=".MainActivity" > 

    <android.support.v4.widget.SlidingPaneLayout 
      android:id="@+id/sliding_layout" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 


     <ListView 
       android:id="@+id/postsView" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_gravity="left" 
       > 
     </ListView> 


      <fragment 
        android:id="@+id/map" 
        android:name="com.google.android.gms.maps.SupportMapFragment" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_gravity="right" 

        /> 


    </android.support.v4.widget.SlidingPaneLayout> 

</LinearLayout> 

답변

1

입니다. 항상 반대쪽 분할 영역을 표시하여 사용자간에 분할 영역을 전환하는 방법을 나타냅니다. 스타일을 통해 그렇게 할 수있는 방법이 있지만 API를 변경하는 옵션이 없습니다.

+0

답장을 보내 주셔서 감사합니다. 그렇게하는 스타일의 예가 있습니까? – tinker

+0

Google+ 앱을 보았습니다 – tinker

+0

@ tinker : Google+ 앱이 'SlidingPaneLayout'을 사용하고 있다는 증거는 무엇입니까? AFAIK, 그들은 'DrawerLayout' (또는 자신 만의 작업)을 사용하고 있습니다. 이것은 UI가 비슷하지만 완전히 별개입니다. – CommonsWare

관련 문제