[英]design custom toggle button in android
Firstly remeber you must have 9 patch your image to make theme reponsive along all devices.首先请记住,您必须有9 个补丁才能使主题响应所有设备。
Also you should have different image for thumb and track .你也应该有不同的拇指和轨道图像。
then in this way you can make the similar sliding switch那么这样你就可以做出类似的滑动开关
<Switch android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:thumb="@drawable/thumb_blue"
android:track="@drawable/track_grey"
android:textOn="Male"
android:textOff="Female"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.