介绍
这期内容当中小编将会给大家带来有关怎么在Android应用中实现一个加载数据帧动画效果,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
<强>实现步骤:强>
<强> 1,xml布局强>
& lt;及# 63;xml version=?.0”;编码=皍tf-8", # 63;比; http://schemas.android.com/apk/res/android" & lt; RelativeLayout xmlns: android=?; android: layout_width=癿atch_parent" android: layout_height=癿atch_parent" android:取向=皏ertical"比; & lt; TextView android: id=癅 + id/textview" android: layout_width=癿atch_parent" android: layout_height=?0 dp" android: layout_alignParentBottom=皌rue" android: layout_margin=?0 dp" android:背景=癅drawable/animationtk" android:重力=癱enter" android:文本=暗慊鞯龆? 输入textColor=癮ndroid: # fff" android: textSize=?8 dp"/比; & lt;/RelativeLayout>
<强> 2。活动代码强>
包cll.com.myapplication; 进口android.app.Activity; 进口android.os.Bundle; 进口android.view.View; 进口android.widget.TextView;/* * * @Description奔跑小人的动画弹框,可以用作加载数据界面 * 2017-4-3 http://blog.csdn.net/android_cll */公共类RuningManActivity扩展活动实现视图。OnClickListener { 私人TextView TextView;//点击按钮 @Override 保护空白>包cll.com.myapplication; 进口android.app.ProgressDialog; 进口android.content.Context; 进口android.graphics.drawable.AnimationDrawable; 进口android.os.Bundle; 进口android.widget.ImageView; 进口android.widget.TextView;/* * * @Description:自定义加载数据弹框 * @author 2017-4-3 http://blog.csdn.net/android_cll */公开课CustomProgressDialog延伸ProgressDialog { 私人AnimationDrawable mAnimation; 私人ImageView mImageView; 私人字符串mLoadingTip; 私人TextView mLoadingTv; 私人int mResid; 公共CustomProgressDialog(上下文语境,字符串内容,int id) { 超级(上下文); 这一点。mLoadingTip=内容; 这一点。mResid=id; setCanceledOnTouchOutside(真正的); } @Override 保护空白> & lt;及# 63;xml version=?.0”;编码=皍tf-8", # 63;比; http://schemas.android.com/apk/res/android" & lt; RelativeLayout xmlns: android=?; android: layout_width=皐rap_content" android: layout_height=皐rap_content" android: layout_gravity=癱enter" android:取向=皏ertical"比; & lt; ImageView android: id=癅 + id/loadingIv" android: layout_width=皐rap_content" android: layout_height=皐rap_content" android:背景=癅anim/animation"/比; & lt; TextView android: id=癅 + id/loadingTv" android: layout_width=皐rap_content" android: layout_height=皐rap_content" android: layout_alignBottom=癅 + id/loadingIv" 输入textColor=癮ndroid: # fff" android: layout_centerHorizontal=皌rue" android: textSize=?0 sp" android:文本=罢诩釉刂小?比; & lt;/RelativeLayout>
<强> 5。动物文件下的帧动画文件强>
& lt;及# 63;xml version=?.0”;编码=皍tf-8", # 63;比; & lt; animation-list android:一次通过=癴alse" xmlns: android=癶ttp://schemas.android.com/apk/res/android" 比; & lt;项目android:可拉的=癅mipmap/progress_loading_image"android:持续时间=?50“/比; & lt;项目android:可拉的=癅mipmap/progress_loading_imagey"android:持续时间=?50“/比; & lt;/animation-list>
上述就是小编为大家分享的怎么在Android应用中实现一个加载数据帧动画效果了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注行业资讯频道。