- (void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor=[UIColorwhiteColor];
//添加UIImageView
imageView=[[UIImageViewalloc] initWithFrame:self.view.frame];
//添加按钮
CGRect buttonRect = CGRectMake(100, 200, 30, 10);
UIButton *recogizeBtn = [UIButtonbuttonWithType:UIButtonTypeCustom];
recogizeBtn.frame = buttonRect;
[recogizeBtnsetTitle:@"new Button" forState:UIControlStateNormal];
[recogizeBtn setBackgroundColor: [UIColorclearColor]];
[recogizeBtn addTarget:selfaction:@selector(recognize:)forControlEvents:UIControlEventTouchUpInside];
[imageViewaddSubview:recogizeBtn];
[self.viewaddSubview:imageView];
// Do any additional setup after loading the view, typically from a nib.
}
-(IBAction)recognize:(id)sender
{
UIAlertView *alertResult = [[UIAlertView alloc]initWithTitle:@"result" message:@"welcome" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
[alertResult show];
}