Android ( JAVA )/개발
[Android] SlidingDrawer 간단 사용법
Always Newbie
2021. 12. 21. 22:23
반응형
SMALL
👼🏻 초보 안드로이드 개발자가 매번 구글링하기 싫어서 정리하는 블로그 👼🏻
평소 앱사용하다보면 하단에서 끌어 올려서 설정 및 기능을 보신적 있으시죠?
오늘은 그걸 한번 해볼꺼에요!!!!!! ( 근데 정작 저는 프로젝트나 앱 개발할때 많이 안써본거같아요 ㅎㅎ... 더 노력해야겠꾼 🧐)
역시나 뷰부터 그립니다!!!
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:padding="20dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="⬇️ 버튼을 위로 드래그 해보세요 ! ⬇️"
android:textSize="20dp"
android:gravity="center"
/>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/content"
android:handle="@+id/handle">
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="터치한채 위로!" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00ff00"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/cat"
/>
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
🌟 아무 이벤트도 없고 하여서 이번엔 코드가 없어요~
반응형
코드만 봐서는 잘 모르겠죠?
짜잔 실행 결과입니다!!!
SMALL
응용 방법은 너무 무궁무진하니 직접 하나씩 하나씩 해보세요!
이로써 코드는 끝 입니다
👼🏻 초보 안드로이드 개발자가 매번 구글링하기 싫어서 정리하는 블로그 👼🏻
반응형
LIST