framelayout 布局可以实现动画吗

Error 404 (Not Found)!!1
404. That’s an error.
The requested URL /1978271/ was not found on this server.
That’s all we know.1048人阅读
android备忘录(15)
导包省略……
acticity.java
public class MainActivity
extends Activity {
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout layout=new
FrameLayout(this);//创建帧布局对象layout
FrameLayout.LayoutParams
frameLayout =new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);//设置帧布局的高宽属性
FrameLayout.LayoutParams
viewPream =new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);//设置布局控件的属性
TextView txt=new
TextView(this);//创建TextView控件
txt.setText("我是房泽龙");//设置文字
ImageView img=new
ImageView(this);//创建图片控件
img.setImageResource(R.drawable.right);//设置图片文件
Button button=new
Button(this);//创建按钮控件
button.setText("按我");//设置按钮文字
layout.addView(img,
viewPream);//将控件添加到布局中去
layout.addView(txt,
viewPream);//三者的添加有顺序,后添加的默认覆盖先添加的控件
layout.addView(button,
viewPream)//;
super.addContentView(layout,frameLayout);//显示布局管理器
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:128373次
积分:2432
积分:2432
排名:第14571名
原创:112篇
转载:24篇
评论:40条
(1)(2)(1)(6)(6)(12)(20)(1)(5)(8)(26)(7)(13)(11)(17)玩转Android---2D图形及动画---Frame动画 - 花郎 - ITeye技术网站
博客分类:
Frame动画其实就是逐帧动画,用法也比Tween动画简单,只需要创建一个AnimationDrawable对象来表示Frame动画,然后通过addFrame方法把每一帧要显示的内容加进去就行了,最后通过start方法就可以播放这个动画了,通过还可以使用
setOneShot()方法来设置动画是否重复播放。
再这里,还需要设置图片的所在位置,首先要在res/anim目录下创建一个xml配置文件,用于存放图片资源的索引,配置的是
一个以&animation-list&根原素和&item&子元素
下面用3种方式来实现这个Frame动画
第一种:直接继承Activity,使用&animation-list&列表来实现
&?xml version="1.0" encoding="utf-8"?&
&LinearLayout xmlns:android="/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="逐帧动画"
&LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"&
android:id="@+id/start"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="开始播放动画"/&
android:id="@+id/stop"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="停止播放动画"/&
&/LinearLayout&
&ImageView
android:id="@+id/imgview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@anim/birthday"
&/LinearLayout&
res/anim/birthday.xml
&?xml version="1.0" encoding="utf-8"?&
&animation-list xmlns:android="/apk/res/android"
android:oneshot="true"&
&item android:drawable="@drawable/birthday1" android:duration="300"/&
&item android:drawable="@drawable/birthday2" android:duration="300"/&
&item android:drawable="@drawable/birthday3" android:duration="300"/&
&item android:drawable="@drawable/birthday4" android:duration="300"/&
&item android:drawable="@drawable/birthday5" android:duration="300"/&
&item android:drawable="@drawable/birthday6" android:duration="300"/&
&item android:drawable="@drawable/birthday7" android:duration="300"/&
&item android:drawable="@drawable/birthday8" android:duration="300"/&
&item android:drawable="@drawable/birthday9" android:duration="300"/&
&/animation-list&
FramesActivity.java
package com.loulijun.
import android.app.A
import android.graphics.drawable.AnimationD
import android.os.B
import android.view.V
import android.widget.B
import android.widget.ImageV
public class FramesActivity extends Activity {
private AnimationD
private Button start,
private ImageV
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
img = (ImageView)findViewById(R.id.imgview);
start = (Button)findViewById(R.id.start);
stop = (Button)findViewById(R.id.stop);
//获得背景色,并转换为AnimationDrawable对象
frameanim = (AnimationDrawable)img.getBackground();
//为按钮添加监听事件
start.setOnClickListener(new Button.OnClickListener()
public void onClick(View v) {
//开始动画
frameanim.start();
stop.setOnClickListener(new Button.OnClickListener()
public void onClick(View v) {
// 停止动画
frameanim.stop();
效果如下:具体自己下载运行,我只截了一张图,没有做成gif的图片
(419.1 KB)
下载次数: 154
论坛回复 /
(0 / 1941)
浏览: 538102 次
来自: 成都
浏览量:13543
浏览量:13968
浏览量:33586
多谢分享~
好文章的。
引用classes.dex.dex2jar.jar
拖入 j ...
讲解的简明易懂,多谢啦!
更为详细的图文介绍,可参考这个http://blog.csdn ...I have a FrameLayout in which I have placed two identical TextViews.
I want to be able to translate the first view to the left (which I have done and is working like a charm). However I want to be able to click the TextView underneath it to perform an action.
When I try to click the bottom TextView, the top TextView gets clicked again instead. I have a feeling this is because the way animations are rendered and the change in actual x,y position doesn't take effect.
This is what I have so far.
&?xml version="1.0" encoding="utf-8"?&
&FrameLayout xmlns:android="/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" &
android:layout_width="fill_parent"
android:layout_height="50dip"
android:text="@string/hello"
android:id="@+id/unbutt"
android:gravity="right|center_vertical"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:text="@string/hello"
android:id="@+id/butt" /&
&/FrameLayout&
import android.app.A
import android.os.B
import android.view.V
import android.view.View.OnClickL
import android.view.animation.A
import android.view.animation.Animation.AnimationL
import android.view.animation.TranslateA
import android.widget.TextV
public class Main extends Activity implements AnimationListener, OnClickListener
/** Called when the activity is first created. */
private class BottomViewClick implements OnClickListener
public void onClick(View v) {
Toast.makeText(v.getContext(), "Second Click", 5).show();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.butt);
tv.setBackgroundColor(0xffb71700);
tv.setOnClickListener(this);
TextView tv2 = (TextView)findViewById(R.id.unbutt);
tv2.setBackgroundColor(0xffb700ff);
tv2.setOnClickListener(new BottomViewClick());
private boolean revealed =
public void onClick(View v) {
if(!revealed)
a = new TranslateAnimation(0f, -200f, 0f, 0f);
a = new TranslateAnimation(-200f, 0f, 0f, 0f);
a.setDuration(500);
a.setFillAfter(true);
a.setAnimationListener(this);
v.startAnimation(a);
public void onAnimationEnd(Animation animation) {
if(revealed)
revealed =
revealed =
public void onAnimationRepeat(Animation animation) {
public void onAnimationStart(Animation animation) {
解决方案 You have ICS in the tag, so I assume that's what your target is.
In that case, the Animation objects you're using are essentially deprecated in favor of the
The old way of doing it only moves the visual location of the View while the physical location remains the same.
You would have to move it yourself by manipulating the margins of the view.
Using an ObjectAnimator on the other hand allows you to physically move the object along with it's visual component.
本文地址: &
我在我所放置两个相同TextViews一个的FrameLayout。我希望能够翻译的第一个视图向左(我已经做了,并正在努力像一个魅力)。不过,我希望能够点击下面的TextView它来执行操作。当我尝试单击底部的TextView,顶部的TextView被再次点击来代替。我有一种感觉,这是因为动画的方式呈现,并在实际的X的变化,Y位置不生效。这是我迄今。 <?XML版本=“1.0”编码=“UTF-8”&GT?;<的FrameLayout的xmlns:机器人=“/apk/res/android”
机器人:layout_width =“FILL_PARENT”
机器人:layout_height =“FILL_PARENT”>
<的TextView
机器人:layout_width =“FILL_PARENT”
机器人:layout_height =“50dip”
机器人:文字=“@字符串/你好”
机器人:ID =“@ + ID / unbutt”
机器人:重力=“右| center_vertical”
<的TextView
机器人:layout_width =“FILL_PARENT”
机器人:layout_height =“50dip”
机器人:文字=“@字符串/你好”
机器人:ID =“@ + ID /对接”/>< /&的FrameLayout GT; 在code: 进口android.app.A进口android.os.B进口android.view.V进口android.view.View.OnClickL进口android.view.animation.A进口android.view.animation.Animation.AnimationL进口android.view.animation.TranslateA进口android.widget.TextV公共类主要活动扩展实现AnimationListener,OnClickListener{
/ **当第一次创建活动调用。 * /
私有类BottomViewClick实现OnClickListener{
公共无效的onClick(视图v){
Toast.makeText(v.getContext(),“二按”,5).show();
}}@覆盖公共无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.main);
TextView的电视=(的TextView)findViewById(R.id.butt);
tv.setBackgroundColor(0xffb71700);
tv.setOnClickListener(本);
TextView中TV2 =(的TextView)findViewById(R.id.unbutt);
tv2.setBackgroundColor(0xffb700ff);
tv2.setOnClickListener(新BottomViewClick());}
私人布尔透露= FALSE;
公共无效的onClick(视图v){
如果(!透露)
一个=新TranslateAnimation(0F,-200f,0F,0F);
一个=新TranslateAnimation(-200f,0F,0F,0F);
a.setDuration(500);
a.setFillAfter(真);
a.setAnimationListener(本);
v.startAnimation(一);
公共无效onAnimationEnd(动画动画){
如果(揭秘)
透露= FALSE;
透露= TRUE;
公共无效onAnimationRepeat(动画动画){
公共无效onAnimationStart(动画动画){
}} 解决方案 您必须在标签ICS,所以我想这就是你的目标是什么。在这种情况下,动画你使用是赞成的类。做旧的方式仅在物理位置保持不变移动查看的视觉位置。你将不得不自己动手通过操纵视图的边缘移动。使用 ObjectAnimator ,另一方面可以让你身体随着它的可视化组件移动的对象。的
本文地址: &
扫一扫关注官方微信iOS中可以实现动画的方式 - 侠情小飞 - 博客园
先简单说一下CALayer
iOS 的动画都是基于 CALayer 的,每个UIView都对应有一个CALayer。所以修改UIView的属性所呈现的动画都是CALayer实现的。CALayer不能响应事件。下图是UIView和CALyer的关系&
iOS中可以实现动画的方式,有不对的地方敬请指正
UIView动画
&[UIView animateWithDuration:&#(NSTimeInterval)#& animations:&#^(void)animations#&];
&[UIView animateWithDuration:&#(NSTimeInterval)#& animations:&#^(void)animations#& completion:&#^(BOOL finished)completion#&];
&[UIView animateWithDuration:&#(NSTimeInterval)#& delay:&#(NSTimeInterval)#& options:&#(UIViewAnimationOptions)#& animations:&#^(void)animations#& completion:&#^(BOOL finished)completion#&];
&[UIView animateWithDuration:&#(NSTimeInterval)#& delay:&#(NSTimeInterval)#& usingSpringWithDamping:&#(CGFloat)#& initialSpringVelocity:&#(CGFloat)#& options:&#(UIViewAnimationOptions)#& animations:&#^(void)animations#& completion:&#^(BOOL finished)completion#&];
&[UIView animateKeyframesWithDuration:&#(NSTimeInterval)#& delay:&#(NSTimeInterval)#& options:&#(UIViewKeyframeAnimationOptions)#& animations:&#^(void)animations#& completion:&#^(BOOL finished)completion#&];
CoreAnimation核心动画&
CAAnimation:核心动画的基础类,不能直接使用,负责动画运行时间、速度的控制,本身实现了CAMediaTiming协议。
CAPropertyAnimation:属性动画的基类(通过属性进行动画设置,注意是可动画属性),不能直接使用。
CAAnimationGroup:动画组,动画组是一种组合模式设计,可以通过动画组来进行所有动画行为的统一控制,组中所有动画效果可以并发执行。
CATransition:转场动画,主要通过滤镜进行动画效果设置。
CABasicAnimation:基础动画,通过属性修改进行动画参数控制,只有初始状态和结束状态。
CAKeyframeAnimation:关键帧动画,同样是通过属性进行动画参数控制,但是同基础动画不同的是它可以有多个状态控制。
基础动画、关键帧动画都属于属性动画,就是通过修改属性值产生动画效果,开发人员只需要设置初始值和结束值,中间的过程动画(又叫“补间动画”)由系统自动计算产生。和基础动画不同的是关键帧动画可以设置多个属性值,每两个属性中间的补间动画由系统自动完成,因此从这个角度而言基础动画又可以看成是有两个关键帧的关键帧动画。
下面利用CABasicAnimation实现一个简单的缩放动画
CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimation.duration=.3;
scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
scaleAnimation.fromValue = @(1);
scaleAnimation.toValue = @(1.5);
scaleAnimation.fillMode = kCAFillModeF
scaleAnimation.removedOnCompletion = NO;&&&&&&&
[view.layer addAnimation:scaleAnimation forKey:@"transformscale"];
**注意点** 如果fillMode=kCAFillModeForwards和removedOnComletion=NO,那么在动画执行完毕后,图层会保持显示动画执行后的状态。但在实质上,图层的属性值还是动画执行前的初始值,并没有真正被改变。
CAKeyframeAnimation用法和CABasicAnimation类似,多了一个values属性
CAAnimationGroup动画组可以把基础动画和关键帧动画加入进animations属性
在实际项目中很多需求使用UIView动画或者基本动画就可以实现,比如下面比较常用的缩放和弹性动画效果
&& & AnimationdemoGif1.gif&& &AnimationdemoGif.gif
炫酷的动画如果想实现更炫酷一点的动画,如雷达,波纹,咻一咻效果,时钟,带动画的指示器等就需要用到UIBezierPath和CAShapeLayer,CAReplicatorLayer等知识。下面简单的说一下CAShapeLayer和CAReplicatorLayer
CAShapeLayer普通CALayer在被初始化时是需要给一个frame值的,这个frame值一般都与给定view的bounds值一致,它本身是有形状的,而且是矩形.CAShapeLayer在初始化时也需要给一个frame值,但是,它本身没有形状,它的形状来源于你给定的一个path,然后它去取CGPath值,它与CALayer有着很大的区别
CAShapeLayer有着几点很重要:1. 它依附于一个给定的path,必须给与path,而且,即使path不完整也会自动首尾相接2. strokeStart以及strokeEnd代表着在这个path中所占用的百分比3. CAShapeLayer动画仅仅限于沿着边缘的动画效果,它实现不了填充效果
CAShapeLayer *layer = [CAShapeLayer layer];&&
layer.frame&&&&&&&& = showView.&&&&&&&&&&&&&&&
layer.strokeColor&& = [UIColor greenColor].CGC&&
layer.fillColor&&&& = [UIColor clearColor].CGC&&
layer.lineCap&&&&&& = kCALineCapS&&&&&&&&&&&&&&
layer.path&&&&&&&&& = path.CGP&&&&&&&&&&&&&&&&&&&
layer.lineWidth&&&& = 4.0f;&&&&&&&&&&&&&&&&&&&&&&&&&&
layer.strokeStart&& = 0.0f;&&
layer.strokeEnd&&&& = 0.1f;
[showView.layer addSublayer:layer];
CAReplicatorLayerCAReplicatorLayer可以复制自己子层的layer,并且复制的出来的layer和原来的子layer拥有相同的动效
贝塞尔曲线UIBezierPath
UIBezierPath主要是用来绘制路径的,分为一阶、二阶.....n阶。一阶是直线,二阶以上才是曲线。而最终路径的显示还是得依靠CALayer
&&&&&初始化方法一共7种
&&&&&[UIBezierPath bezierPath];
&&&&&[UIBezierPath bezierPathWithRect:&#(CGRect)#&];
&&&&&[UIBezierPath bezierPathWithOvalInRect:&#(CGRect)#&];
&&&&&[UIBezierPath bezierPathWithCGPath:&#(nonnull CGPathRef)#&];
&&&&&[UIBezierPath bezierPathWithRoundedRect:&#(CGRect)#& cornerRadius:&#(CGFloat)#&];
&&&&&[UIBezierPath bezierPathWithRoundedRect:&#(CGRect)#& byRoundingCorners:&#(UIRectCorner)#& cornerRadii:&#(CGSize)#&];
&&&&&[UIBezierPath bezierPathWithArcCenter:&#(CGPoint)#& radius:&#(CGFloat)#& startAngle:&#(CGFloat)#& endAngle:&#(CGFloat)#& clockwise:&#(BOOL)#&];
自定义路径常用api& &
自定义路径常用api
&&&&&- (void)moveToPoint:(CGPoint)
&&&&&- (void)addLineToPoint:(CGPoint)
&&&&&- (void)addCurveToPoint:(CGPoint)endPoint controlPoint1:(CGPoint)controlPoint1 controlPoint2:(CGPoint)controlPoint2;
&&&&&- (void)addQuadCurveToPoint:(CGPoint)endPoint controlPoint:(CGPoint)controlP
&&&&&- (void)addArcWithCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise
&&&&&- (void)appendPath:(UIBezierPath *)bezierP
&& && && && && && && && && &&&AnimationdemoGif2.gif
- (void)setup
&&&&_testView=[[UIView alloc] initWithFrame:CGRectMake(30, 300, 100, 100)];
&&&&[self.view addSubview:_testView];
&&&&_testView.layer.backgroundColor = [UIColor clearColor].CGC
&&&&CAShapeLayer *pulseLayer = [CAShapeLayer layer];
&&&&pulseLayer.frame = _testView.layer.
&&&&pulseLayer.path = [UIBezierPath bezierPathWithOvalInRect:pulseLayer.bounds].CGP
&&&&pulseLayer.fillColor = [UIColor redColor].CGC
&&&&pulseLayer.opacity = 0.0;
&&&&CAReplicatorLayer *replicatorLayer = [CAReplicatorLayer layer];
&&&&replicatorLayer.frame = _testView.
&&&&replicatorLayer.instanceCount = 4;
&&&&replicatorLayer.instanceDelay = 1;
&&&&[replicatorLayer addSublayer:pulseLayer];
&&&&[_testView.layer addSublayer:replicatorLayer];
&&&&CABasicAnimation *opacityAnima = [CABasicAnimation animationWithKeyPath:@"opacity"];
&&&&opacityAnima.fromValue = @(0.3);
&&&&opacityAnima.toValue = @(0.0);
&&&&CABasicAnimation *scaleAnima = [CABasicAnimation animationWithKeyPath:@"transform"];
&&&&scaleAnima.fromValue = [NSValue valueWithCATransform3D:CATransform3DScale(CATransform3DIdentity, 0.0, 0.0, 0.0)];
&&&&scaleAnima.toValue = [NSValue valueWithCATransform3D:CATransform3DScale(CATransform3DIdentity, 1.0, 1.0, 0.0)];
&&&&CAAnimationGroup *groupAnima = [CAAnimationGroup animation];
&&&&groupAnima.animations = @[opacityAnima, scaleAnima];
&&&&groupAnima.duration = 4.0;
&&&&groupAnima.autoreverses = NO;
&&&&groupAnima.repeatCount = HUGE;
&&&&[pulseLayer addAnimation:groupAnima forKey:@"groupAnimation"];
-(void)myTest{
&&&&UIView *line=[[UIView alloc] initWithFrame:CGRectMake(0, 100, 400, 1)];
&&&&line.backgroundColor=[UIColor grayColor];
&&&&[self.view addSubview:line];
&&&&_testView1=[[UIImageView alloc] initWithFrame:CGRectMake(0, 100, 300, 200)];
&&&&_testView1.userInteractionEnabled=YES;
&&&&[self.view addSubview:_testView1];
&&&&CGPoint point1= CGPointMake(10, 80);
&&&&CGPoint point2= CGPointMake(10, 200);
&&&&CGPoint point3= CGPointMake(300, 200);
&&&&CGPoint point4= CGPointMake(300, 80);
&&&&_path=[UIBezierPath bezierPath];
&&&&[_path moveToPoint:point1];
&&&&[_path addLineToPoint:point2];
&&&&[_path addLineToPoint:point3];
&&&&[_path addLineToPoint:point4];
&&&&[_path addQuadCurveToPoint:point1 controlPoint:CGPointMake(150, -30)];
&&&&CAShapeLayer *shapeLayer=[CAShapeLayer layer];
&&&&shapeLayer.path=_path.CGP
&&&&shapeLayer.fillColor=[UIColor clearColor].CGC
&&&&shapeLayer.strokeColor=[UIColor orangeColor].CGC
&&&&[_testView1.layer addSublayer:shapeLayer];
&&&&CABasicAnimation *pathAniamtion = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
&&&&pathAniamtion.duration = 3;
&&&&pathAniamtion.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
&&&&pathAniamtion.fromValue = [NSNumber numberWithFloat:0.0f];
&&&&pathAniamtion.toValue = [NSNumber numberWithFloat:1.0];
&&&&pathAniamtion.autoreverses = NO;
&&&&[shapeLayer addAnimation:pathAniamtion forKey:nil];
&&&&UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickk:)];
&&&&[_testView1 addGestureRecognizer:tap];
-(void)clickk:(UITapGestureRecognizer *)tap{
&&&&CGPoint point=[tap locationInView:_testView1];
&&&&if ([_path containsPoint:point]) {
&&&&&&&NSLog(@"点击不规则图形");
补充一--基本动画设置参数在动画方法中有一个option参数,UIViewAnimationOptions类型,它是一个枚举类型,动画参数分为三类,可以组合使用:
1.常规动画属性设置(可以同时选择多个进行设置)UIViewAnimationOptionLayoutSubviews:动画过程中保证子视图跟随运动。UIViewAnimationOptionAllowUserInteraction:动画过程中允许用户交互。UIViewAnimationOptionBeginFromCurrentState:所有视图从当前状态开始运行。UIViewAnimationOptionRepeat:重复运行动画。UIViewAnimationOptionAutoreverse :动画运行到结束点后仍然以动画方式回到初始点。UIViewAnimationOptionOverrideInheritedDuration:忽略嵌套动画时间设置。UIViewAnimationOptionOverrideInheritedCurve:忽略嵌套动画速度设置。UIViewAnimationOptionAllowAnimatedContent:动画过程中重绘视图(注意仅仅适用于转场动画)。 UIViewAnimationOptionShowHideTransitionViews:视图切换时直接隐藏旧视图、显示新视图,而不是将旧视图从父视图移除(仅仅适用于转场动画)UIViewAnimationOptionOverrideInheritedOptions :不继承父动画设置或动画类型。2.动画速度控制(可从其中选择一个设置)UIViewAnimationOptionCurveEaseInOut:动画先缓慢,然后逐渐加速。UIViewAnimationOptionCurveEaseIn :动画逐渐变慢。UIViewAnimationOptionCurveEaseOut:动画逐渐加速。UIViewAnimationOptionCurveLinear :动画匀速执行,默认值。3.转场类型(仅适用于转场动画设置,可以从中选择一个进行设置,基本动画、关键帧动画不需要设置)UIViewAnimationOptionTransitionNone:没有转场动画效果。UIViewAnimationOptionTransitionFlipFromLeft :从左侧翻转效果。UIViewAnimationOptionTransitionFlipFromRight:从右侧翻转效果。UIViewAnimationOptionTransitionCurlUp:向后翻页的动画过渡效果。& &UIViewAnimationOptionTransitionCurlDown :向前翻页的动画过渡效果。& &UIViewAnimationOptionTransitionCrossDissolve:旧视图溶解消失显示下一个新视图的效果。& &UIViewAnimationOptionTransitionFlipFromTop :从上方翻转效果。& &UIViewAnimationOptionTransitionFlipFromBottom:从底部翻转效果。
补充二--keyPathlayer有很多属性,通过animationWithKeyPath修改,列举一下常用的属性:
那么怎么知道这些属性都有哪些呢。1.2.通过runtime3.多看code4app :]

我要回帖

更多关于 framelayout 动画 的文章

 

随机推荐