zoukankan      html  css  js  c++  java
  • 两个按钮(背景图不同)的翻转

    UIButton *downButtonOne = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 50)];

            [downButtonOne setImage:[UIImage imageNamed:@"main_advertisement1.png"] forState:UIControlStateNormal];

            [self addSubview:downButtonOne];

            

            UIButton *downButtonTwo = [UIButton buttonWithType:UIButtonTypeCustom];

            downButtonTwo.frame = CGRectMake(0, 0, self.bounds.size.width, 50);

            [downButtonTwo setImage:[UIImage imageNamed:@"main_advertisement.png"] forState:UIControlStateNormal];

            [self addSubview:downButtonTwo];

            [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(adAnimation) userInfo:nil repeats:YES];

    - (void)adAnimation

    {

        [UIView animateWithDuration:1.0 animations:^{

            [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self cache:YES];

            [self exchangeSubviewAtIndex:0 withSubviewAtIndex:1];

        }];

    }

  • 相关阅读:
    浏览器渲染流程
    MVC模式
    传统的DOM是如何进行渲染的
    报文的概念及理解
    单页面开发与多页面开发的优缺点
    第4次作业
    售票系统
    第三次作业
    第二次作业
    第一次作业
  • 原文地址:https://www.cnblogs.com/qianyindichang/p/3853432.html
Copyright © 2011-2022 走看看