2015년 1월 27일 화요일

[Android][xml] Sliding Drawer 사용법

1. 사용하는 경우 : 슬라이딩 메뉴나 화면 밖에서 슬라이드 되어 표시되게 할때

2. 이클립스 xml 쪽에서 생성

3. Sliding Drawer 내부에 버튼 역할을 하는 @+id/handle과 슬라이딩 되어 나타나는 Content 가 되는 @+id/content가 반드시 포함되어야 한다.

4.  xml 설정


 1) android:allowSingleTap="true"
  handle 클릭할 때 열 수 있도록 할 것인지 설정. 
  디폴트는 true, false설정 시 드래그를 통해서만 열 수 있음

 2) android:animateOnClick="true"
  오픈할때 미끄러지는듯한 애니메이션을 사용 할 것인지 설정. 디폴트는 true.

 3) android:bottomOffset="10dp"
  서랍을 닫았을때 handle과 parent layout 과의 간격

 4) android:content="@+id/content
  슬라이딩 되어 나타나는 내용

 5) android:orientation="vertical"
  SlidingDrawer가 나타나는 방향.
  Horizontal은 우측, Vertical은 아래에서 열림. 디폴트는 vertical.
  좌측, 상단을 하려면 복잡하게 다른 방법을 써야 한다고 함

 6) android:topOffset="100dp"
  SlidingDrawer를 오픈할 때 부모 레이아웃과의 간격.

댓글 없음:

댓글 쓰기