为listview的item添加动画效果
//动画集合
AnimationSet animationSet = new AnimationSet(true);
//alpha动画
Animation animation = new AlphaAnimation(0.0f,1.0f);
animation.setDuration(1300);
animationSet.addAnimation(animation);
//位移动画 效果 从Y方向下落到自己的位置
//RELATIVE_TO_SELF 相对自身
//-1.0f 起始Y坐标为自身的高度
//TranslateAnimation(int fromXType, float fromXValue,
// int toXType, float toXValue,
// int fromYType, float fromYValue,
// int toYType, float toYValue)
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF,0.0f,Animation.RELATIVE_TO_SELF,0.0f,
Animation.RELATIVE_TO_SELF,-1.0f,Animation.RELATIVE_TO_SELF,0.0f);
animation.setDuration(1300);
animationSet.addAnimation(animation);
//设置子视图动画及持续时间
LayoutAnimationController controller = new LayoutAnimationController(animationSet,0.5f);
//绑定到listview
mListView.setLayoutAnimation(controller);
为listview的item添加动画效果的更多相关文章
- Java 给PPT添加动画效果(预设动画/自定义动画)
PPT幻灯片中对形状可设置动画效果,常见的动画效果为内置的固定类型,即动画效果和路径是预先设定好的固定模板,但在设计动画效果时,用户也可以按照自己的喜好自定义动画动作路径.下面,通过Java后端程序代 ...
- ListView中内容的动画效果
LayoutAnimationController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置动画效果,可以在XML文件中设置,亦可以在Java代码中设置. 一种直接在 ...
- PopupWindow添加动画效果
1.定义PopupWindow弹出与消失的两个动画文件,放在anim文件夹下 popup_enter.xml <?xml version="1.0" encoding=&qu ...
- 给Activity切换过程添加动画效果
首先,在资源文件中定义一些动画效果 例如: <scale android:duration="@android:integer/config_mediumAnimTime" ...
- 网站滑到指定的位置给div添加动画效果
<!DOCTYPE html> <html> <head> <style> .anim-show { width:100px; height:100px ...
- 114自定义UITableViewCell(扩展知识:为UITableViewCell添加动画效果)
关键操作: 效果如下: ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UITableViewCo ...
- android中listview的item滑动删除效果(已解决listview点击问题)
领导看到iphone上tableview有个滑动删除的效果,要求在android上也实现,搜了下资料,实现起来比较简单,可弄到后面,居然不能点击了,把一篇文章中的代码修改了一下,捣鼓了一番,搞定,下面 ...
- html5+css3画太极并添加动画效果
可兼容移动端视图 效果图如下:太极图是可以旋转的 具体实现如下: <!DOCTYPE html> <html lang="zh"> <head> ...
- Android开发UI之给ListView设置布局动画效果
1.通过JAVA代码添加,资源文件基本上不修改 XML文件,只添加了一个ListView,就不贴XML文件的代码了. java代码: public class MainActivity extends ...
随机推荐
- phpstudy的apache端口没有被占用,也有vc9,防火墙也没开,也开杀毒软件,就是无法启动apache
我电脑装了一个独立的apche和一个phpstudy的apache,我学习是教学视频是php5.2而phpstudy刚好支持. 但是我在选取phpstudy的php版本5.3n以上就无法启动apach ...
- linux io stack
- delphi 弹出选择目录窗口
if not SelectDirectory( '请选择输出文件路径','/',directory) then begin Exit; end; 使用SelectDirectory函数注意要在use下 ...
- Python —条件语句
条件语句 Python条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块. 可以通过下图来简单了解条件语句的执行过程: Python程序语言指定任何非0和非空(null ...
- oracle数据库相关知识点
已知表如下:
- Python对时间的转换
1.将字符串的时间转换为时间戳 方法: a = "2013-10-10 23:40:00" 将其转换为时间数组 import time timeArray = time.strpt ...
- Generate Ubuntu Install Media On Mac
Opps, my computer system was broken again... Let's repire it. Introduction The system of my PC is br ...
- 计算ScrollView的当前页面
//每页宽度 CGFloat pageWidth = sender.frame.size.width; //根据当前的坐标与页宽计算当前页码 int currentPage = floor((send ...
- 【C#】时间戳转换
今天有时间戳转换的需求,网上找了半天才找到相关代码,经测试有效,特作此笔记和大家分享! 1.时间戳转为C#格式时间 /// <summary> /// 时间戳转为C#格式时间 /// &l ...
- github 删除仓库 repository
1.点开想要删除的仓库 2点击setting 3.拉到最下面 4.点击 Delete this repository 5.输入想删除仓库的名字 点击