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

        }];

    }

  • 相关阅读:
    Ios国际化翻译工具
    软件是什么
    angular2实现图片轮播
    DIV+CSS布局最基本的内容
    angular2中使用jQuery
    如何在Ionic2项目中使用第三方JavaScript库
    Ionic2项目中使用Firebase 3
    Ionic2中ion-tabs输入属性
    The Router路由
    templating(模板)
  • 原文地址:https://www.cnblogs.com/qianyindichang/p/3853432.html
Copyright © 2011-2022 走看看