#import "WashViewController.h"

@interface WashViewController ()

@end

@implementation WashViewController
-(void)btnClik{
NSLog(@"Touch");

}
- (void)viewDidLoad {
[super viewDidLoad];
//快速创建自定义按钮,
UIButton *button =[UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"press" forState:UIControlStateNormal];
[button sizeToFit];
[button setBackgroundImage:[[UIImage imageNamed:@"logo.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]
forState:UIControlStateNormal];
button.center=CGPointMake(100,50);
[button addTarget:self action:@selector(btnClik) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end
//添加图片
UIImage *img = [UIImage imageNamed:@"LOGO.png"];
CGFloat imgH = img.size.height;
CGFloat imgW = img.size.width;
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, imgW, imgH) ];
imgView.image = img;

[self.view addSubview:imgView];