UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(150, 230, 19, 24)];
[button setBackgroundImage:[UIImage imageNamed:@"button.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
- (void)buttonClick:(id)sender {
// Do something ...
}
No comments:
Post a Comment