- 添加文本与编辑框:
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 200,40)];
label.backgroundColor = [UIColor blueColor];
label.textColor = [UIColor blackColor];
label.text = @"Mylabel";
[label setFont:[UIFont boldSystemFontOfSize:14]];
[self.view addSubview:label];
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(20, 70, 260, 30)];
textField
iOS开发:Xcode9.1中添加UI元素与对话框

这篇博客介绍了在iOS开发中如何使用Xcode9.1添加文本、编辑框和ImageView。重点强调了将图片资源正确导入项目的方法,并对比了旧式警告框(UIAlertView)与新式警告框(UIAlertController)的使用,指出在使用UIAlertController时需要注意视图加载状态。
最低0.47元/天 解锁文章
15

被折叠的 条评论
为什么被折叠?



