你能给我一些链接或示例程序来在视图上创建UIButton并对其进行操作,我们需要在其他视图上再创建一个按钮。 请帮忙
答案 0 :(得分:4)
-(void)action:(id)sender
{
}
UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect];
button.frame = CGRectMake(x, y, width, height);
button.titleLabel.font = [UIFont systemFontOfSize: 30];
[button setTitle:@"TITLE"
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(action:)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];