RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
IOSuiview一个动画的使用写了个测试记忆力的

 代码很简单  主要看看

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:主机域名虚拟主机、营销软件、网站建设、静宁网站维护、网站推广。

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion

方法的使用

代码如下:

- (void)viewDidLoad

{

    [superviewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

    

   arr=[[NSMutableArrayalloc]init];

    

    CGSize size=[[UIScreen mainScreen] bounds].size;

    

    float x=size.width/3.0;

    float y=size.height/3.0;

    

    

    for (int i=0; i<9; i++) {

       UIButton *button=[[UIButtonalloc]initWithFrame:CGRectZero];

        button.backgroundColor=[UIColorredColor];

        int d=i%3;

        int t=i/3;

        button.frame=CGRectMake(0+x*d, 0+y*t,x-20, y-10);

        button.tag=i;

        

        [self.view addSubview:button];

        

        [arr addObject:button];

    }

    

    [self showIn];

}

 

-(void)showIn{

    int r=arc4random()%9;

    

    UIButton *button=[arr objectAtIndex:r];

    

   [UIViewanimateWithDuration:0.1delay:1.0options:UIViewAnimationOptionCurveLinearanimations:^{

    

       button.backgroundColor=[UIColorclearColor];

   } completion:^(BOOL finished) {

       button.backgroundColor=[UIColorredColor];

       [self showIn];

   }];

    

}


文章标题:IOSuiview一个动画的使用写了个测试记忆力的
URL地址:http://ncwzjz.com/article/goighs.html