2014-05-22 4 views
0
나는 안드로이드 SlidePaneLayout 사용하고, 내가 그 안에 둘은 LinearLayouts, leftpanerightPane이을 가지고

곳에서 왼쪽 창을 통해 오른쪽 창 슬라이드 닫힌 상태. 오른쪽 창의 너비를 줄이면 250dp이됩니다.닫힌 상태에서 SlidePaneLayout 안드로이드의 커버 레이아웃의 폭을 줄이는 방법

내가 지정한 너비에 관계없이 오른쪽 창은 전체 창을 닫음 상태으로 나타냅니다. 내가 rightpane의 너비를 줄여서 배경에 왼쪽 패널 조금만 볼 수 있도록 닫힌 상태에 있습니다.

이것은 내 SlidingPaneLayout xml입니다.

<android.support.v4.widget.SlidingPaneLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/sp" > 

    <!-- Left side pane. (Master) --> 
    <LinearLayout android:id="@+id/leftpane" 
     android:layout_width="250dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="left" 
     android:background="#DFDEFF" 
     android:orientation="horizontal" > 
     </LinearLayout> 

     <!-- Right side page. (Slave) --> 
     <LinearLayout android:id="@+id/rightpane" 
      android:layout_width="250dp" 
      android:layout_height="match_parent" 
      android:layout_gravity="right" 
      android:background="#CFDEFF" 
      android:layout_weight="1" 
      android:orientation="horizontal"> 
     </LinearLayout> 

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

인터넷에서 사용할 수있는 모든 자습서를 시도했지만 작동하지 않습니다.

도와주세요. 나를 RIGHT 창에 marginLeft을 추가 도움이 내가 aswell 잠시 동안이 주제에 대한 혼란 봤는데

+0

이 라이브러리를 확인하십시오. https://github.com/StevenRudenko/ActionContentView/ – Onur

+0

감사합니다. 오 누어, 이것을 시도하고 알려 드리겠습니다. –

답변

0

... .

<!-- Right side page. (Slave) --> 
    <LinearLayout android:id="@+id/rightpane" 
     android:layout_width="250dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="right" 
     android:background="#CFDEFF" 
     android:layout_weight="1" 
     android:orientation="horizontal" 
     android:layout_marginLeft="200dp"> 
    </LinearLayout> 

왼쪽에 200dp 국경을 추가 그래서 당신이가는 뭔가를 얻었다. (닫혀있을 때 200dp의 왼쪽 창을 볼 수있게합니다)