为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 ...
随机推荐
- spring+mybatis 手动开启和提交事务
spring配置文件 事务控制管理器transactionManager <!-- (事务管理)transaction manager, use JtaTransactionManager fo ...
- DER input, Integer tag error的异常处理
1.首先我向大家介绍一下我做的东西,发生这个异常的情况. 我做的是一个电签的系统,在调用某公司的API生成证书,然后与安证通进行同步证书的任务. 2.问题具体的异常 具体异常如下: 2016/08/2 ...
- 使用JCIFS获取远程共享文件
package com.jadyer.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOExc ...
- sourceTreee设置忽略的文件
1.忽略不想要的目录,比如bin.obj目录(每次运行本机程序都会变化) 这个在右上角的Settings的Advanced下面的Repository-specific ignore list,点击Ed ...
- [转]word2vec使用指导
word2vec是一个将单词转换成向量形式的工具.可以把对文本内容的处理简化为向量空间中的向量运算,计算出向量空间上的相似度,来表示文本语义上的相似度. 一.理论概述 (主要来源于http://lic ...
- could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
VS2008, 写一个简单的demo的时候出现了这个: 1>------ Build started: Project: GetExportTable, Configuration: Relea ...
- .NET委托和事件
.net学习之委托和事件 1.什么是委托 通俗的说:委托就是一个能够存储符合某种格式(方法签名)的方法的指针的容器 上传图片: 2.委托语法 准备一个方法:string Hello(string ...
- GPT WIN 换硬盘 硬盘克隆或复制 无法确定的问题,硬盘大小不一致换系统。
当你购买了一个新硬盘,希望换掉旧硬盘的时候.发现 GPT + EFI 要求硬盘上的前两个分区必须和旧的一样,否则就无法启动. 这就是你用 分区大师(PartAssist)硬盘克隆完了,也无法启动的原因 ...
- timus 1175. Strange Sequence 解题报告
1.题目描述: 1175. Strange Sequence Time limit: 1.0 secondMemory limit: 2 MB You have been asked to disco ...
- C# 如何获取当前应用程序的上一级路径
Server.MapPath 的使用方法 用法: 1.Server.MapPath ("/") 应用程序根目录所在的位置 如 C:\Inetpub\wwwroot\ 2.Serve ...