今天弄了一下用图片绘制开关按钮.
效果图:
还有我两张start图片和stop图片就是上面的图片,到时候大家可以按照自己的图片调用..
Main.xml文件
在xml进入这段代码就ok了。
<ImageView
android:id="@+id/start"
android:layout_width="150.px"
android:layout_height="80.px"
android:src="@drawable/start"
android:layout_x="120.0px"
android:layout_y="250.0px"
/>
Activity文件