拿去逗小孩

来源:互联网 发布:淘宝支点运动是真的吗 编辑:程序博客网 时间:2024/05/01 05:51


- (void)viewDidLoad {

    [superviewDidLoad];

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

    

    

//    摸脸

     _imageview=[[UIImageViewalloc]initWithFrame:self.view.frame];

    _imageview.image=[UIImageimageNamed:@"angry_00.jpg"];

    _imageview.userInteractionEnabled=YES;

    [self.viewaddSubview:_imageview];

    UIButton *button =[UIButtonbuttonWithType:UIButtonTypeSystem];

    button.frame=CGRectMake(100,170, 180, 150);


    [button addTarget:selfaction:@selector(perss:)forControlEvents:UIControlEventTouchUpInside];

    [_imageview addSubview:button];

    

//   foot left

//    _imageview.image=[UIImage imageNamed:@"footLeft_00.jpg"];

//    _imageview.userInteractionEnabled=YES;

    

    UIButton *button1=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button1.frame=CGRectMake(185,600, 50, 50);

//    button1.backgroundColor=[UIColor greenColor];

//    [_imageview addSubview:button1];

    [button1 addTarget:selfaction:@selector(footleft:)forControlEvents:UIControlEventTouchUpInside];

    [_imageview addSubview:button1];


//    foot right

    UIButton *button2=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button2.frame=CGRectMake(130,600, 50, 50);

//    button2.backgroundColor=[UIColor greenColor];

    [button2 addTarget:selfaction:@selector(footringht:)forControlEvents:UIControlEventTouchUpInside];

      [_imageview addSubview:button2];

    

//    stomach

    UIButton *button3=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button3.frame=CGRectMake(120,430, 130, 150);

//    button3.backgroundColor=[UIColor greenColor];

    [button3 addTarget:selfaction:@selector(stomach:)forControlEvents:UIControlEventTouchUpInside];

    [_imageview addSubview:button3];

    

    

//  drink

    UIImageView *image1=[[UIImageViewalloc]initWithFrame:CGRectMake(10,400, 50, 50)];

    image1.image=[UIImageimageNamed:@"drink"];

    

    [_imageview addSubview:image1];

    

    UIButton *button4=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button4.frame=CGRectMake(10,400, 50, 50);

//    button4.backgroundColor=[UIColor greenColor];

    [_imageview addSubview:button4];

    [button4 addTarget:selfaction:@selector(drink:)forControlEvents:UIControlEventTouchUpInside];

    

    

//    cymbal

    UIImageView *image2=[[UIImageViewalloc]initWithFrame:CGRectMake(10,450, 50, 50)];

    image2.image=[UIImageimageNamed:@"cymbal"];

    [_imageview addSubview:image2];

    

    UIButton *button5=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button5.frame=CGRectMake(10,450, 50, 50);

//    button5.backgroundColor=[UIColor greenColor];

    [_imageview addSubview:button5];

    

    [button5 addTarget:selfaction:@selector(cymbal:)forControlEvents:UIControlEventTouchUpInside];

    

//    scratch 挠屏

    UIImageView *image3=[[UIImageViewalloc]initWithFrame:CGRectMake(10,500, 50, 50)];

    image3.image=[UIImageimageNamed:@"scratch"];

    [_imageview addSubview:image3];

    

    UIButton *button6=[[UIButtonalloc]initWithFrame:CGRectMake(10,500, 50, 50)];

//    button6.backgroundColor=[UIColor greenColor];

    [_imageview addSubview:button6];

    [button6 addTarget:selfaction:@selector(scratch:)forControlEvents:UIControlEventTouchUpInside];

    

//   pie

    UIImageView *image4=[[UIImageViewalloc]initWithFrame:CGRectMake(10,550, 50, 50)];

    image4.image=[UIImageimageNamed:@"pie"];

    

    [_imageview addSubview:image4];

    UIButton *button7=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button7.frame=CGRectMake(10,550, 50, 50);

    [button7 addTarget:selfaction:@selector(pie:)forControlEvents:UIControlEventTouchUpInside];

    [_imageview addSubview:button7];

    

    

    UIImageView *image5=[[UIImageViewalloc]initWithFrame:CGRectMake(310,400, 50, 50)];

    image5.image=[UIImageimageNamed:@"eat"];

    [_imageview addSubview:image5];

    

    UIButton *button8=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button8.frame=CGRectMake(310,400, 50, 50);

    [_imageview addSubview:button7];

    [button7 addTarget:selfaction:@selector(eat:)forControlEvents:UIControlEventTouchUpInside];

    

    UIImageView *image6=[[UIImageViewalloc]initWithFrame:CGRectMake(310,450, 50, 50)];

    image6.image=[UIImageimageNamed:@"fart"];

    [_imageview addSubview:image6];

    

    UIButton *button9=[UIButtonbuttonWithType:UIButtonTypeSystem];

    button9.frame=CGRectMake(310,450, 50, 50) ;

                   

    [_imageview addSubview:button9];

    [button9 addTarget:selfaction:@selector(fart:)forControlEvents:UIControlEventTouchUpInside];

    

    

    

    

    

    

    

    

    

    

}

//    摸脸

-(void)perss:(UIButton *)button{

    self.imgArr=[NSMutableArrayarray];

    for (NSInteger i =6; i<80; i++) {

        NSString *str=[NSStringstringWithFormat:@"knockout_%02ld.jpg",i];

        [self.imgArraddObject:[UIImageimageNamed:str]];

       

    }

    self.imageview.animationImages =self.imgArr;

    self.imageview.animationDuration=2;

    self.imageview.animationRepeatCount=5;

    [_imageviewstartAnimating];

    

}

//   foot left

-(void)footleft:(UIButton *)button{

    NSMutableArray *arr =[NSMutableArrayarray];

    for (NSInteger i =0; i<30; i++) {

        NSString *str=[NSStringstringWithFormat:@"footLeft_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    self.imageview.animationImages=arr;

    self.imageview.animationDuration=1;

    self.imageview.animationRepeatCount=1;

    [self.imageviewstartAnimating];

}

//    foot right

-(void)footringht:(UIButton *)button{

    NSMutableArray *arr =[NSMutableArrayarray];

    for (NSInteger i =0; i<30; i++) {

        NSString *str=[NSStringstringWithFormat:@"footRight_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    self.imageview.animationImages=arr;

    self.imageview.animationDuration=1;

    self.imageview.animationRepeatCount=1;

    [self.imageviewstartAnimating];

  

}

//stomach

-(void)stomach:(UIButton *)button{

    NSMutableArray *arr =[NSMutableArrayarray];

    for (NSInteger i =0; i<34; i++) {

        NSString *str=[NSStringstringWithFormat:@"Stomach_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

        

    }

    self.imageview.animationImages=arr;

    self.imageview.animationDuration=1;

    self.imageview.animationRepeatCount=3;

    [self.imageviewstartAnimating];

    

}


//drink


-(void)drink:(UIButton *)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<81; i++) {

        NSString *str=[NSStringstringWithFormat:@"drink_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    _imageview.animationRepeatCount=3;

    _imageview.animationImages=arr;

    _imageview.animationDuration=5;

    [_imageviewstartAnimating];

  

}


-(void)cymbal:(UIButton *)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<13; i++) {

        NSString *str=[NSStringstringWithFormat:@"Cymbal_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

     _imageview.animationImages=arr;

    _imageview.animationDuration=1;

    _imageview.animationRepeatCount=3;

    [_imageviewstartAnimating];

    

}

// scratch

-(void)scratch:(UIButton *)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<56; i++) {

        NSString *str=[NSStringstringWithFormat:@"scratch_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    _imageview.animationImages=arr;

    _imageview.animationDuration=5;

    _imageview.animationRepeatCount=5;

    [_imageviewstartAnimating];

    

}


//   pie

-(void)pie:(UIButton *)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<24; i++) {

        NSString *str=[NSStringstringWithFormat:@"pie_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    _imageview.animationImages=arr;

    _imageview.animationDuration=5;

    _imageview.animationRepeatCount=5;

    [_imageviewstartAnimating];

}



//eat


-(void)eat:(UIButton *)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<40; i++) {

        NSString *str=[NSStringstringWithFormat:@"eat_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    _imageview.animationImages=arr;

    _imageview.animationDuration=2;

    _imageview.animationRepeatCount=5;

    [_imageviewstartAnimating];

    

}



-(void)fart:(UIButton*)button{

    NSMutableArray *arr=[NSMutableArrayarray];

    for (NSInteger i =0; i<28; i++) {

        NSString *str=[NSStringstringWithFormat:@"fart_%02ld.jpg",i];

        [arr addObject:[UIImageimageNamed:str]];

    }

    _imageview.animationImages=arr;

    _imageview.animationDuration=2;

    _imageview.animationRepeatCount=5;

    [_imageviewstartAnimating];

    

    

}


0 0
原创粉丝点击