该listview实现图片的异步加载,并在加载listview数据时,添加从左向右的动画效果。

在res目录下添加anim文件夹,创建动画xml list_anim.xml

<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android">    <translate         android:fromXDelta="-100%"        android:fromYDelta="0"        android:toXDelta="0"        android:toYDelta="0"        android:duration="500"        android:interpolator="@android:anim/anticipate_overshoot_interpolator"/></set>

然后,在anim目录下再创建一个xml navagation_gridview_anim.xml,这个xml代码不多,就四行

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"    android:animation="@anim/list_anim"    android:animationOrder="normal"    android:delay="0.5"/>

现在,给listview或者gridview添加layoutAnimation属性

<ListView         android:id="@+id/listview"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:background="#00000000"        android:cacheColorHint="#00000000"        android:layoutAnimation="@anim/navagation_gridview_anim"></ListView>

至此,listview就实现了数据加载时添加动画效果

更多相关文章

  1. MTK Android滑盖或翻盖处理驱动
  2. Android(安卓)Animation 总汇
  3. TranslateAnimatin 实现的动态菜单
  4. Android原生下拉刷新SwipeRefreshLayout实践
  5. RecyclerView加载不同view实现效果--IT蓝豹
  6. Android(安卓)Jetpack架构组件-Paging介绍及实践
  7. MediaBrowserService 音乐播放项目
  8. Android热修复原理及实现
  9. android弹出式菜单(效果爆炸)

随机推荐

  1. Android(安卓)Studio开发环境的搭建
  2. android:foreground="?attr/selectableIt
  3. LinearLayout源码分析
  4. Android(安卓)4.4创建The Master/Detail
  5. 微信5.0一键关注和下载
  6. android中View, Window, Activity, Windo
  7. 1、重写TextView的onDraw方法
  8. 【Android(安卓)界面效果18】Android软件
  9. Android(安卓)登录密码RSA加密
  10. 正确设置Android(安卓)Studio代理配置