2012-02-20 4 views
1

Android에서 SlidingDrawer와 관련된 문제가 발생했습니다. 나는 수평 슬라이딩 서랍으로 스크린을 만들고있다. 잘 작동하고 있으며 예상대로 개폐됩니다. 서랍을 닫을 때 50dpi의 내용을보기 위해 bottomOffset을 50dip으로 설정했지만이 상황은 발생하지 않습니다.Android : SlidingDrawer with bottomOffset 및 내용 표시

서랍이 닫히면 화면의 오른쪽과 핸들 사이의 거리가 50dip으로 표시되지만 내용보기가 보이지 않게되어 핸들과 화면 가장자리 사이에 50dpi의 검은 색 공간이 생깁니다. 쇼 아래 이미지는 : 나는 핸들의 버튼을 누르면

enter image description here

, 내용이 표시 여부 표시로 변경 얻을 수 있다는 것, 그리고 그것은 appers. enter image description here

내가 코드를 변경하고 예상 얻을 시도하기 위해 http://blog.sephiroth.it/2011/03/29/widget-slidingdrawer-top-to-bottom/에서 SlidingDrawer 소스 코드를 다운로드 : 나는 아래 Imagem의처럼, 핸들을 누를 필요없이 컨텐츠를 볼 수 유지하고 싶습니다 결과,하지만 나는 얻지 못하고있다.

슬라이딩 서랍의 XML :

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 

android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

<br.com.dina.partial.example.MultiDirectionSlidingDrawer 
    xmlns:my="http://schemas.android.com/apk/res/br.com.dina.partial.example" 
    android:id="@+id/map_slider" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_alignParentBottom="true" 
    my:handle="@+id/Handle" 
    my:content="@+id/ViewLayout" 
    my:direction="rightToLeft"   
    my:bottomOffset="-65dip" 
    android:layout_below="@+id/test"> 

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

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

     <com.markupartist.android.widget.ActionBar 
      android:id="@+id/actionbar" 
      style="@style/ActionBar"/>  

     <FrameLayout android:id="@+id/ViewContent" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="@android:color/white" /> 

    </LinearLayout> 

</br.com.dina.partial.example.MultiDirectionSlidingDrawer> 

</RelativeLayout>  

내가 원하는 것을 달성 할 수있는 방법이 있나요? 는 XML

+0

당신이 SlidingDrawer의 XML을 게시 할 수 있을까요? : 했는가? – koopaking3

답변

0

사용 onDrawerScrollListener, onDrawerOpenListeneronDrawerCloseListener 서랍의 상태에 따라 특정 항목의 가시성을 변경에게 추가 편집

많은 감사

. 따라서 "서랍이 닫혀 있고 콘텐츠보기가 보이지 않습니다"라고 말하면 콘텐츠 화면을 VISIBLE으로 설정하십시오. 이것을 시도해보고 그것이 어떻게 진행되는지 알려주세요.

편집 때문에이 같은 일이

drawer.setOnDrawerCloseListener(new OnDrawerCloseListener(){ 
     @Override 
     public void onDrawerClosed() { 
      //get the ViewContent by id and set visibility to VISIBLE 
    }); 
+0

안녕하세요 @ koopaking3, 당신이 말한 것을 시도했지만 작동하지 않습니다. 콘텐츠보기가 어디로 가고 있는지 또는 어떤 일이 일어나고 있는지 알 수 없지만 표시되지는 않습니다. 감사합니다. – Thiago

+0

위의 샘플 코드를 추가했습니다 ... 이와 비슷한 결과를 얻었지만 작동하지 않았습니까? – koopaking3

+0

안녕하세요 @ koopaking3, 예, 나는 똑같은 짓을했는데 작동하지 않습니다. 문제는 콘텐츠 가시성에 있지 않지만 콘텐츠 위치 (나는 생각합니다)에있는 것으로 보입니다. – Thiago