IOSuiview一个动画的使用写了个测试记忆力的-创新互联

代码很简单  主要看看

在周至等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、成都网站制作 网站设计制作按需网站建设,公司网站建设,企业网站建设,高端网站设计,成都全网营销推广,外贸网站制作,周至网站建设费用合理。

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

方法的使用

代码如下:

- (void)viewDidLoad

{

  [super viewDidLoad];

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

  arr=[[NSMutableArray alloc] 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=[[UIButton alloc] initWithFrame:CGRectZero];

    button.backgroundColor=[UIColor redColor];

    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];

  [UIView animateWithDuration:0.1 delay:1.0 options:UIViewAnimationOptionCurveLinear animations:^{

    button.backgroundColor=[UIColor clearColor];

  } completion:^(BOOL finished) {

    button.backgroundColor=[UIColor redColor];

    [self showIn];

  }];

}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享文章:IOSuiview一个动画的使用写了个测试记忆力的-创新互联
链接分享:http://myzitong.com/article/dhodii.html