Android Animation与ListView结合的滑动效果
来源:互联网 发布:尼康官方调焦软件 编辑:程序博客网 时间:2024/05/23 11:53
目标效果图:
主要是重写BaseAdapter的getView()方法时,给布局的item添加Animation动画效果。
代码片段:
@Overridepublic View getView(int position, View convertView, ViewGroup parent) {ViewHolder holder;if(convertView==null){holder = new ViewHolder();convertView = inflater.inflate(R.layout.list_item, null);holder.tv = (TextView)convertView.findViewById(R.id.tv);holder.ll = (LinearLayout)convertView.findViewById(R.id.ll);convertView.setTag(holder);}else{holder = (ViewHolder)convertView.getTag();}holder.tv.setText(list.get(position));ScaleAnimation sa = new ScaleAnimation(0.5f, 1, 0.5f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);sa.setDuration(500);holder.ll.setAnimation(sa);return convertView;}
项目代码:https://github.com/DevinShine/AnimationDemo
以后会继续增加其它的Animation效果
1 0
- Android Animation与ListView结合的滑动效果
- Android--ListView的item水平滑动效果
- android ListView增加Animation效果
- Android 结合滑动控件ListView滑动删除
- Android ListView 滑动删除效果
- android 取消listview的默认滑动到顶的效果
- android特效展示一:ListView的item滑动效果
- android listview 去除滑动产生的黑影效果
- Android SwipeListView 实现ListView的滑动删除效果
- Android SwipeListView 实现ListView的滑动删除效果
- Android listview 去除滑动产生的黑影效果
- Android 实现ListView的滑动删除效果(转)
- ListView增加Animation效果
- 【Android】ListView滑动时首字母提示效果
- android--SwipeListView实现ListView滑动删除效果
- android ListView滑动首字母顶部停靠效果
- android ListView滑动首字母顶部停靠效果
- Android Listview 滑动时置顶悬浮效果
- java面试题之 使用两个int翻转字符串
- Throwable中的toString方法
- 20060811-Discrete cosine transforms, JPEG, and software compatibility
- Android利用Spinner从数据库中读取数据并实现2级互动
- 无线网络学习笔记(1)
- Android Animation与ListView结合的滑动效果
- PHP中延迟静态绑定机制
- 利用数据结构栈求解迷宫问题
- 利用替换变量提高Oracle交互性(define)
- S_hui工作室
- POJ 1379 模拟退火法
- Android simple implementation Dropium - iOS7 Login screen
- Dumplicate targets in Xcode5
- 类和对象(下)