Android 重写系统进度条

2014-11-24 08:45:07 来源: 作者: 浏览: 0


-->
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_white_48" android:pivotX="50%"
android:pivotY="50%"
android:framesCount="12"
android:frameDuration="100" />
我把前面的注释去掉,大家再看:
< xml version="1.0" encoding="utf-8" >
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_white_48"
android:pivotX="50%"
android:pivotY="50%"
android:framesCount="12"
android:frameDuration="100" />
就剩这么多了,然后分析下这个文件(总共没有几行代码了嘛)
xmlns:android="http://schemas.android.com/apk/res/android" 约束,不说了,也不需要我们关注
android:drawable="@drawable/spinner_white_48" 这个相信接触过android的都知道这是指定了一个图标吧
android:pivotX="50%"
android:pivotY="50%" 这两行代码是指定了一个点(point嘛)那是什么点呢,中心点,我们让那个圆圈围着这个点转动,就有了动画效果,所以它是指定的围绕哪个点转动(为了证明我的猜想,我在后来自定义的代码中将他们都改成了0,它们就围绕左上角的那个点转动了,所以证明了我的猜想是对的哦,不信的朋友可以再写完以后自己试一下)
android:framesCount="12" 这个是啥帧的count我也不太清楚了
android:frameDuration="100"这个应该是转圈持续的时间,我们可以在做完后改一改这些数字,就知道他们干嘛的啦。


看完这个文件,我们想,已经没有用到其他的文件了,只是缺少一个图标,我到360安全卫士拷贝了一个(虽然个人不太喜欢这个软件的霸道,但图片还是挺喜欢的,嘿嘿)


-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: