Example of switch button effect drawn by Android based on ImageView
This article describes the switch button effect drawn by Android based on ImageView. Share with you for your reference, as follows:
Today I made a picture to draw the switch button
design sketch:
And my two start pictures and stop pictures are the above pictures. At that time, you can call them according to your own pictures
Main.xml file
It is OK to enter this code in XML.
Activity file
OK done
More readers interested in Android related content can view the special topics of this site: summary of Android layout skills, summary of Android view skills, introduction and advanced tutorial of Android development, summary of Android debugging skills and solutions to common problems, summary of Android multimedia operation skills (audio, video, recording, etc.) Usage Summary of Android basic components and Android controls
I hope this article will help you in Android programming.