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

        }];

    }

  • 相关阅读:
    『GoLang』接口
    『GoLang』结构体与方法
    『GoLang』包
    『GoLang』字典Map
    『GoLang』数组与切片
    利用griddata进行二维插值
    HTML 标签的 for 属性
    python之成像库pillow
    Python之模块IO
    StringIO和BytesIO
  • 原文地址:https://www.cnblogs.com/qianyindichang/p/3853432.html
Copyright © 2011-2022 走看看