การทำ DrawerMenu บน App Android

Drawer Menu คือเมนู ที่มาพร้อมกับ Library android Support V4 งั้นเรามาติดตั้ง Library กัน ไปที่ Project Structor

การอัพ android support V4

การเช็คว่าเราติดตั้ง Library android Support V4 สำเร็จไหม ? มาสเตอร์ จะไปที่ build.gradle ในส่วนของ Module

เปิดขึ้นมาจะเห็นในส่วนของ dependencies มี android support V4 แบบนี้

กลับมาที่ activity_main เพิ่ม เทคของ android.support.v4.widget.DrawerLayout ไปแทนที่ layout เดิม

เพิ่ม Layout Menu ที่จะแสดง สังเกตุ ต่ำแหน่งจะเป็น ที่ start และ ต้องกำหนดพื้นสี่ด้วย

เสร็จแล้วลองทดสอบที่ Genymotion หรือ Emulator

ลองลากนิ้วจากขอบ ซ้ายไปขวา

แค่นี่ก็เรียบร้อยโรงเรียน มาสเตอร์ คุณสามารถ Download Source Code ไปทดสอบที่ https://github.com/masterUNG/EasyPicture/tree/master

มาสเตอร์ อึ่ง

จงอย่าคิดที่จะเดิน จงเดินเลย

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade