各位大侠请帮忙,关于android登录特效问题!万分感谢! 我想做一个android客户端登录界面,输入帐号、密码访问PC端后台数据库,想做这样一个效果:点击登录按钮出现一个登录的动画效果,等验证完帐号密码正确后,进入主界面,就跟电脑上的QQ登录效果一样,在android端该如何实现,请大侠指点,我是一个初学者,多多帮助! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先你需要这个动画效果的每张图片,然后使用Android系统动画机制中的帧动画,设置间隔时间循环播放google一下Android Frame Animation,你就知道 代码中:/* 定义一个ImageView用来显示动画 */ ImageView img = new ImageView(mContext); /* 装载动画布局文件 */ img.setBackgroundResource(R.anim.frameanimation); /* 构建动画 */ frameAnimation = (AnimationDrawable) img.getBackground(); /* 设置是否循环 */ frameAnimation.setOneShot(false); /* 设置该类显示的动画 */ this.setBackgroundDrawable(frameAnimation);xml文件R.anim.frameanimation:1.<?xml version="1.0" encoding="utf-8"?> 2.<animation-list xmlns:android="http://schemas.android.com/apk/res/android" 3. android:oneshot="false"> 4. 5. <item android:drawable="@drawable/a1" android:duration="500" /> 6. <item android:drawable="@drawable/a2" android:duration="500" /> 7. <item android:drawable="@drawable/a3" android:duration="500" /> 8. <item android:drawable="@drawable/a4" android:duration="500" /> 9. <item android:drawable="@drawable/a5" android:duration="500" /> 10. <item android:drawable="@drawable/a6" android:duration="500" /> 11. <item android:drawable="@drawable/a7" android:duration="500" /> 12. <item android:drawable="@drawable/a8" android:duration="500" /> 13. <item android:drawable="@drawable/a9" android:duration="500" /> 14. <item android:drawable="@drawable/a10" android:duration="500" /> 15. <item android:drawable="@drawable/a11" android:duration="500" /> 16. <item android:drawable="@drawable/a12" android:duration="500" /> 17. <item android:drawable="@drawable/a13" android:duration="500" /> 18. <item android:drawable="@drawable/a14" android:duration="500" /> 19. <item android:drawable="@drawable/a15" android:duration="500" /> 20.</animation-list> 你可以看看Frame动画的AnimationDrawable类 来实现你想达到的效果。 搞个线程在那儿画动画,你这边向远程传数据,当返回成功后,把那个线程关掉,换个view或是activity都行搞个更简单的就是加个loading gif动画http://gundumw100.iteye.com/blog/1182109 用两个xml布局文件,一个布局文件里面是动画.开个线程计时,计时到了换配置文件.然后线程里面的循环break就行了 app inventor 问题多多啊,大家有遇到吗? Android系统的字体大小设置 关于短信功能问题 webview加载页面有重叠 怎样使androidscrollview动态请求数据 各位大神速度来救救小弟呀! 求大家帮帮忙:viewpager 页卡内部内容变化 写一个从网上下载歌词并保存到sd卡的程序的问题,急。。 android 调用系统文件浏览器并返回文件路径 修改手机识别码,串号 activity跳转后 service是否工作 初学android,先请教一下安卓中播放rtsp流媒体机制
/* 定义一个ImageView用来显示动画 */
ImageView img = new ImageView(mContext);
/* 装载动画布局文件 */
img.setBackgroundResource(R.anim.frameanimation);
/* 构建动画 */
frameAnimation = (AnimationDrawable) img.getBackground();
/* 设置是否循环 */
frameAnimation.setOneShot(false); /* 设置该类显示的动画 */
this.setBackgroundDrawable(frameAnimation);
xml文件R.anim.frameanimation:
1.<?xml version="1.0" encoding="utf-8"?>
2.<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
3. android:oneshot="false">
4.
5. <item android:drawable="@drawable/a1" android:duration="500" />
6. <item android:drawable="@drawable/a2" android:duration="500" />
7. <item android:drawable="@drawable/a3" android:duration="500" />
8. <item android:drawable="@drawable/a4" android:duration="500" />
9. <item android:drawable="@drawable/a5" android:duration="500" />
10. <item android:drawable="@drawable/a6" android:duration="500" />
11. <item android:drawable="@drawable/a7" android:duration="500" />
12. <item android:drawable="@drawable/a8" android:duration="500" />
13. <item android:drawable="@drawable/a9" android:duration="500" />
14. <item android:drawable="@drawable/a10" android:duration="500" />
15. <item android:drawable="@drawable/a11" android:duration="500" />
16. <item android:drawable="@drawable/a12" android:duration="500" />
17. <item android:drawable="@drawable/a13" android:duration="500" />
18. <item android:drawable="@drawable/a14" android:duration="500" />
19. <item android:drawable="@drawable/a15" android:duration="500" />
20.</animation-list>
搞个更简单的就是加个loading gif动画
http://gundumw100.iteye.com/blog/1182109