iOS-基本知识汇总
2015-08-05 10:20
393 查看
1.隐藏按钮 sender.hidden = YES; 2.按钮常用基础知识 //获取按钮指定状态下的文字 NSString *text = [sender titleForState:UIControlStateNormal]; //获取当前状态下的文字 NSString *text = sender.currentTitle; //按钮是否可用 sendBtn.enabled = YES/NO; 3.控制view层上的按钮控件是否可以点击 self.optionsView.userInteractionEnabled = YES/NO; 4.UIAlertView用法 //弹出一个对话框 UIAlertView * msgView = [[UIAlertView alloc] initWithTitle:@"操作提示" message:@"恭喜您过关啦"delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", @"哈哈",nil]; //显示对话框 [msgView show]; //监控UIAlertView某个按钮需要代理UIAlertViewDelegate, //实现UIAlertView的代理方法 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"%ld",buttonIndex); } 5.UITableView,一般当数据少于屏幕的高度时候,下方会有多余的tableViewCell.解决办法: self.tableView.tableFooterView = [[UIView alloc] init]; 6.图片变成圆形,需要设置其属性key path: layer.masksToBounds Boolean yes layer.cornerRadius Number 25(图片尺寸的1/2) iOS-基本知识汇总 - lightingbolt - lightingbolt的博客 7.textField赋值 [self.contactText setText:@""]; 7.UIView展示的几种形式,推出(push),模态(由底部向上弹出) a).push: XNewsReviewViewController* reviewVc = [[XNewsReviewViewController alloc] init]; [self.navigationController pushViewController:reviewVc animated:YES]; b).模态 XNewsSettingViewController * settingVc=[[XNewsSettingViewController alloc] init]; XNewsNavigationController *nav = [[XNewsNavigationController alloc] initWithRootViewController:settingVc]; [self presentViewController:nav animated:YES completion:^{ }]; 9.tableViewCell相关 a).系统默认箭头 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; //显示最右边的箭头 b).选中tableViewCell时候去掉选中效果 cell.selectionStyle = UITableViewCellSelectionStyleNone;lightingBolt
相关文章推荐
- iOS 读书笔记-cookie
- iOS在照片上添加水印
- iOS 开发的中英文入门推荐书籍都有哪些?
- IOS Xcode 插件
- iOS图形库CorePlot
- xcode语法高亮插件
- iOS7使用iOS8上的方法报错处理
- iOS开发中的测试框架
- iOS开发_常用的正则表达式
- iOS开发基础之用三种不同方式创建Table View应用
- iOS项目的完整重命名方法图文教程
- iOS证书与推送通知证书制作过程遇到的问题
- IOS中的代理模式
- iOS开发基础之用三种不同方式创建Table View应用
- 58.iOS6 7 cell适配 tableView背景
- iOS中注册功能的体验探究
- iOS 9应用开发教程之iOS 9新特性
- iOS 8设置CLLocation授权
- iOS 8应用内跳转到系统设置
- IOS 如何实现滑动返回上一页