---
title: "ios 动画"
author: "修博龙泉"
date: "2012-12-14T13:36:53Z"
tags: []
categories: ["移动开发"]
slug: "ios"
draft: false
lastmod: "2012-12-17T13:26:06Z"
id: 1747722
url: "https://longquan.iteye.com/blog/1747722"
---

```java

//开启动画效果代码
    [uiview animatewithduration:2 animations:^{
        //动画
    } completion:^(bool finish){
        //最后位置
        self.searchtext.frame = CGRectMake (0,100,200,31);
    }];


```

//长按闪动效果

```java

 [uiview animatewithduration:0.3 
                          delay:0 
                        options:uiviewanimationoptionallowuserinteraction 
                     animations:^{
                         cell.contentview.backgroundcolor = [UIColor orangeColor];
                         cell.contentView.layer.shadowOpacity = 0.7;
                     } 
                     completion:nil
     ];
[uiview animatewithduration:0.3 
                          delay:0 
                        options:uiviewanimationoptionallowuserinteraction 
                     animations:^{  
                         cell.contentview.backgroundcolor = [UIColor redColor];
                         cell.contentView.layer.shadowOpacity = 0;
                     }
                     completion:nil
     ];

```