《IOS应用开发教程》.pptVIP

  • 3
  • 0
  • 约2.94万字
  • 约 88页
  • 2018-12-31 发布于湖北
  • 举报
完成了界面组件设置之后,就要实现按钮的功能了。在AppDelegate.m文件中,为button添加单击事件,并实现。 21.button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 22.button.frame = CGRectMake(90, 100, 150, 80); 23.[button setTitle:@button forState:UIControlStateNormal]; 24.[button setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; 25.[self.window addSubview:button]; 26.//添加按钮单击事件 27.[button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; 28.self.window.backgroundColor = [UIColor whiteColor]; 29.[self.window makeKeyAndVisible]; 30.return YES; 31.//实现按钮单击事件 32.- (void)click 33

文档评论(0)

1亿VIP精品文档

相关文档