นักผจญโค้ด (CODE HUNTER)

how to remove left(start) margin from actionbar's custom layout (ลบช่องว่างระหว่าง title และ ปุ่ม home ของ actionbar)


          Toolbar กำหนดค่า default ของ contentInsetStart ไว้ที่ 16dp ทำให้เวลาเราทำ custom toolbar จะมีช่องว่างระหว่าง navigation icon และ title
           ใน Material Design spec มี attribute ตัวหนึ่งที่ชื่อว่า contentInsetStartWithNavigation  และกำหนดค่าเริ่มต้นไว้ที่ 16dp เราสามารถกำหนดค่าของ contentInsetStartWithNavigation  ให้เป็น 0dp ได้ในกรณีที่เรามีกำหนด navigation icon ไว้



ก่อนกำหนดค่าให้ใหม่กับ contentInsetStartWithNavigation

หลังกำหนดค่าให้ใหม่กับ contentInsetStartWithNavigation  เป็น 0dp
Share:

0 ความคิดเห็น:

แสดงความคิดเห็น

Recent Posts

Popular Posts

About Me

About Me