object c 源代码动态增加按钮,并给按钮一个点击事件 - (void)viewDidLoad { [super viewDidLoad]; CGRect frame = CGRectMake(90, 200, 200, 60); UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = frame; btn.backgroundColor = [UIColor clearColor]; [btn setTitle:@"动态添加一个按钮!" for More