在ios7开发中遇到的一些deprecated的问题
来源:互联网 发布:九大算法 编辑:程序博客网 时间:2024/05/16 14:21
cell.textLabel.textAlignment = UITextAlignmentCenter;
现在要写成cell.textLabel.textAlignment =NSTextAlignmentCenter;
UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:nil] autorelease];
需要写成
static NSString *TableSampleIdentifier =@"TableSampleIdentifier";
UITableViewCell *cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1reuseIdentifier:TableSampleIdentifier];
[selfpresentModalViewController:calendarViewanimated:YES];
改成 [selfpresentViewController:calendarViewanimated:YEScompletion:^{}];
新接口的差别是提供了一个参数,允许你传入一个block。这个block的回调方法在VC的viewWillDisappear方法后调用。也就是被隐藏的VC对象被释放后运行回调。
这样做的好处:可以方便做多个UI效果之间的衔接和转换。
在IOS7的PageControl控件
调用[self.subviewsobjectAtIndex:i]
取出的不是UIImageView而是UIView
所以updateDots方法应该这样写:
-(void) updateDots{ for (int i = 0; i < [self.subviews count]; i++) { UIView* dotView = [self.subviews objectAtIndex:i]; if ([dotView isKindOfClass:[UIImageView class]]) { UIImageView* dot = (UIImageView*)dotView; if (i == self.currentPage) dot.image = _activeImage; else dot.image = _inactiveImage; }else{ if (i == self.currentPage) [dotView setBackgroundColor:[UIColor colorWithPatternImage:_activeImage]]; else [dotView setBackgroundColor:[UIColor colorWithPatternImage:_inactiveImage]]; } }}
[text drawAtPoint:textPt withFont:[UIFontsystemFontOfSize:14.0f]]
在IOS7中应该写
#define NLSystemVersionGreaterOrEqualThan(version) ([[[UIDevice currentDevice] systemVersion] floatValue] >= version) #define IOS7_OR_LATER NLSystemVersionGreaterOrEqualThan(7.0) if (IOS7_OR_LATER) { UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; font = [font fontWithSize:14.0f]; [text drawAtPoint:textPt withAttributes:@{NSFontAttributeName:font}]; }else { [text drawAtPoint:textPt withFont:[UIFont systemFontOfSize:14.0f]]; }
- 在ios7开发中遇到的一些deprecated的问题
- iOS7适配遇到的一些问题
- iOS7适配遇到的一些问题
- iOS7适配遇到的一些问题
- iOS7适配遇到的一些问题
- iOS7适配遇到的一些问题
- iOS7适配遇到的一些问题
- 在sharepoint开发中遇到的一些问题和解决方案
- 我在ios游戏开发中遇到的一些问题
- 在开发中图片浏览遇到的一些简单问题
- 我在Android开发中遇到的一些问题
- Android7.0在蓝牙开发中遇到的一些问题
- 在开发中遇到的一些错误
- ios7遇到的问题
- 在Jupyter中遇到的一些问题
- 软件开发中遇到的一些问题
- 开发过程中遇到的一些问题
- 开发ReportViewer中遇到的一些问题
- C++习题 对象转换
- jmp指令
- C/C++开发语言系列之1--const用法总结1
- 线程调用有参函数案例
- Android实现推送方式解决方案
- 在ios7开发中遇到的一些deprecated的问题
- js给下拉框赋值
- @Override 报错
- Unique Paths
- 数据传输指令--mov
- EF 增、删、改、查
- 世界杯足彩,你该这样押才对!
- UINavigationController
- 自动管理多线程案例