图片旋转(扫描,等待效果)的几种方式
2016-07-25 23:19
218 查看
<ProgressBar android:id="@+id/progress" android:indeterminateDrawable="@drawable/rotate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" />
drawable中文件 rotate
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/rotate" android:pivotX="50%" android:pivotY="50%" />
没有现成图,则有
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="360"> <shape android:shape="ring" android:innerRadiusRatio="3" android:thicknessRatio="8" android:useLevel="false"> <gradient android:type="sweep" android:useLevel="false" android:startColor="#6BD3FF" android:centerColor="#FF7121" android:centerY="0.50" android:endColor="#FFFF00" /> </shape> </animated-rotate>
以上是利用progressBar实现的,也可以直接用补间动画RotateAnimation实现。
RotateAnimation anim = new RotateAnimation// (0, 360, // 角度 RotateAnimation.RELATIVE_TO_SELF, 0.5f,// 宽 RotateAnimation.RELATIVE_TO_SELF, 0.5f);// 高 anim.setDuration(700);// 时长 anim.setRepeatCount(Integer.MAX_VALUE); act_img.startAnimation(anim);
多说一下,带进度条的progressbar
<ProgressBar android:id="@+id/progress" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="15dp" android:layout_marginTop="3dp" android:max="100" android:progress="10" />
相关文章推荐
- [LeetCode] Combination Sum IV 组合之和之四
- 使用Unity3D的50个技巧
- Android 自定义属性
- lintcode minimum-adjustment-cost 最小调整代价
- Opencv指针
- Deletion order
- Mybatis中的#与$的区别
- Java 基础----内部类
- 产品助理day13
- JavaScript 中apply()、call()和bind()方法的使用
- EL表达式经验教训 javax.el.PropertyNotFoundException 出错
- 324. Wiggle Sort II
- POJ 2234 Matches Game
- 新站的SEO应如何操作?
- Android studio 更改log颜色
- 大话设计模式23----命令模式
- 【HDU 杭电 1876】看病要排队
- 17、Drools——KieHelper的用法,通过模板的例子说明
- NET Core-TagHelper实现分页标签
- 关于跨界疯人院