Android Story

[Android] Switch Custom

WhiteDuck 2019. 1. 15. 17:03

Android Switch Custom



I have posted a custom switch that used just an 'ON', 'OFF' image. 

Lastly, I've learned about the usage of track and thumb. Then I’m updating the next version of customizing.

So, I repost switch custom.


지난번 포스트에서 ON/OFF 통자 이미지를 통해서 커스터마이징을 하는 글을 올렸였다. 

최신에 다시 접하면서 track과 thumb의 의미를 다시 알고 커스터마이징을 하는 방법을 다시 올리게 되었다.



I would not update the result. It’s just the same as the previous one.

However, I hope you to not to talk about the size of the switch. This is for defining the function.


결과물은 이전 포스트와 같아서 올리지 않겠다.

그리고 스위치의 크기는 정확히 조율한 것이 아니므로 의미상 참고를 주 목적으로 봐주었으면 한다.



Plus, I started to do a switch for not finding SwitchCompat from the device of the book


추가적으로, SwitchCompat이 저자의 디바이스에서 보여지지가 않아서 Switch를 진행하게 되었다. 




1. style.xml






2. switch_track.xml





투명 배경과 실제 트랙을 합치는 것이 포인트.



3. switch_thumb.xml




4. Accept (적용)



반응형