Android Custom Appbar with Drawer

사용 버전: Android Studio 4.1

사용 언어: Kotlin 1.4.10


안드로이드 Custom Appbar with Drawer을 알아보겠습니다.


Drawer은 화면 밖에서 튀어나오는 설명 창 같은 겁니다.

아래는 예시입니다.






먼저, Custom Appbar가 필요합니다.



그리고, drawer 기본 설정이 필요합니다. 아래 글에서 처음부터 binding 부분까지만 해주시고 다시 돌아와 주세요.




binding까지 마치셨으면, drawer를 적용할 kotlin 파일로 가서 drawer를 불러옵니다.

저는 Drawer의 id를 mainDrawerLayout으로 설정했습니다.





그리고, DrawerToggle을 만듭니다.





이 토글을 동기화시켜 줍니다.






전체 코드 모습은 이렇습니다.




끝.


카테고리: Android

댓글

이 블로그의 인기 게시물

Python OpenCV 빈 화면 만들기

Python urllib.parse.quote()

Python bytes.fromhex()

Android AVD Ram size change

Forensics .pyc 파일 .py로 복구하기

Android Minimum touch target size

KiCad 시작하기 7 (FreeRoute 사용하기 2)

Android Notification with Full Screen

C++ OpenCV 모폴로지 침식, 팽창

KiCad 시작하기 2 (PCB 만들기)