首页 > 其他 > 详细

3.小项目:摸我干啥!

时间:2015-07-28 20:37:09      阅读:234      评论:0      收藏:0      [点我收藏+]

技术分享

---------------  ViewController.m  --------------- 

#import "ViewController.h"


@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIButton *head;

- (IBAction)topClick;

- (IBAction)bottomClick;

- (IBAction)leftClick;

- (IBAction)rightClick;

- (IBAction)leftRotateClick;

- (IBAction)rightRotateClick;

- (IBAction)minusClick;

- (IBAction)plusClick;

@end


@implementation ViewController

- (IBAction)topClick

{

    CGRect frame = self.head.frame;

    frame.origin.y -= 10;

    self.head.frame = frame;

}

- (IBAction)bottomClick

{

    CGRect frame = self.head.frame;

    frame.origin.y += 10;

    self.head.frame = frame;

}

- (IBAction)leftClick

{

    CGRect frame = self.head.frame;

    frame.origin.x -= 10;

    self.head.frame = frame;

}

- (IBAction)rightClick

{

    CGRect frame = self.head.frame;

    frame.origin.x += 10;

    self.head.frame = frame;

}

- (IBAction)leftRotateClick

{

    

    self.head.transform = CGAffineTransformRotate(self.head.transform, -M_PI_4);


}

- (IBAction)rightRotateClick

{

    self.head.transform = CGAffineTransformRotate(self.head.transform, M_PI_4);

}

- (IBAction)minusClick

{

    CGRect frame = self.head.frame;

    frame.size.width -= 10;

    frame.size.height -= 10;

    self.head.frame = frame;

}

- (IBAction)plusClick

{

    CGRect frame = self.head.frame;

    frame.size.width += 10;

    frame.size.height += 10;

    self.head.frame = frame;

}

@end 

3.小项目:摸我干啥!

原文:http://www.cnblogs.com/lixiang2015/p/4683515.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!