ios7 tweak
2013-10-21 18:14
465 查看
1.[UIView performWithoutAnimation:] 替代
[UIView setAnimationsEnabled:NO];
code here...
[UIView setAnimationsEnabled:YES];
2.实现tableView:estimatedHeightForRowAtIndexPath:代理函数或者设置estimatedRowHeight属性值,提供一个预估高度值,
对于可变高度的cell的表格视图可改进性能
3.UISearchDisplayController新增属性:displaysSearchBarInNavigationBar,可让搜索控件显示在导航栏,但不可与showsScopeBar同时设置为YES,即显示在导航栏的搜索控件不能有范围选择栏
4.UIResponder新增属性keyCommands,相应的有个新增类
5.新增UIInputView,可用来自定义键盘或者扩展默认键盘
6.CTTelephonyNetworkInfo:用来判断手机当前的网络类型,是edge还是LTE或其他,currentRadioAccessTechnology的值可为:
CTRadioAccessTechnologyCDMA1x
CTRadioAccessTechnologyCDMAEVDORev0
CTRadioAccessTechnologyCDMAEVDORevA
CTRadioAccessTechnologyCDMAEVDORevB
CTRadioAccessTechnologyEdge
CTRadioAccessTechnologyGPRS
CTRadioAccessTechnologyHSDPA
CTRadioAccessTechnologyHSUPA
CTRadioAccessTechnologyLTE
CTRadioAccessTechnologyWCDMA
CTRadioAccessTechnologyeHRPD
7.下载字体:CTFontDescriptorMatchFontDescriptorsWithProgressHandler
获取可下载字体:
新增UIApplicationUserDidTakeScreenshotNotification通知,当用户截屏时触发
keyboardDismissMode:scrollView滚动时隐藏[b]键盘[/b]
self.scrollView.keyboardDismissMode =
UIScrollViewKeyboardDismissModeOnDrag;//刚拖动scrollView就隐藏键盘
self.scrollView.keyboardDismissMode =
UIScrollViewKeyboardDismissModeInteractive;//从键盘上面点(scrollView未遮挡部分)向下滑动,键盘会跟着滑动;又往上滑动键盘也会跟着向上滑动
UIScrollViewKeyboardDismissModeNone//默认值,没有任何影响
参考网址:http://www.objc.io/issue-5/iOS7-hidden-gems-and-workarounds.html
[UIView setAnimationsEnabled:NO];
code here...
[UIView setAnimationsEnabled:YES];
2.实现tableView:estimatedHeightForRowAtIndexPath:代理函数或者设置estimatedRowHeight属性值,提供一个预估高度值,
对于可变高度的cell的表格视图可改进性能
3.UISearchDisplayController新增属性:displaysSearchBarInNavigationBar,可让搜索控件显示在导航栏,但不可与showsScopeBar同时设置为YES,即显示在导航栏的搜索控件不能有范围选择栏
4.UIResponder新增属性keyCommands,相应的有个新增类
UIKeyCommand,可用于捕获蓝牙键盘的按键事件,例:
- (NSArray *)keyCommands { return @[[UIKeyCommand keyCommandWithInput:@"f" modifierFlags:UIKeyModifierCommand action:@selector(searchKeyPressed:)]]; } - (void)searchKeyPressed:(UIKeyCommand *)keyCommand { // Respond to the event }
5.新增UIInputView,可用来自定义键盘或者扩展默认键盘
6.CTTelephonyNetworkInfo:用来判断手机当前的网络类型,是edge还是LTE或其他,currentRadioAccessTechnology的值可为:
CTRadioAccessTechnologyCDMA1x
CTRadioAccessTechnologyCDMAEVDORev0
CTRadioAccessTechnologyCDMAEVDORevA
CTRadioAccessTechnologyCDMAEVDORevB
CTRadioAccessTechnologyEdge
CTRadioAccessTechnologyGPRS
CTRadioAccessTechnologyHSDPA
CTRadioAccessTechnologyHSUPA
CTRadioAccessTechnologyLTE
CTRadioAccessTechnologyWCDMA
CTRadioAccessTechnologyeHRPD
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new]; NSLog(@"Current Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology); [NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { NSLog(@"New Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology); }];
7.下载字体:CTFontDescriptorMatchFontDescriptorsWithProgressHandler
获取可下载字体:
CFDictionary *descriptorOptions = @{(id)kCTFontDownloadableAttribute : @YES}; CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes((CFDictionaryRef)descriptorOptions); CFArrayRef fontDescriptors = CTFontDescriptorCreateMatchingFontDescriptors(descriptor, NULL);
Tint images with UIImage.renderingMode
UIImage *img = [UIImage imageNamed:@"myimage"];
img = [img imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
新增UIApplicationUserDidTakeScreenshotNotification通知,当用户截屏时触发
UIScreenEdgePanGestureRecognizer
UIScreenEdgePanGestureRecognizer *recognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleScreenEdgeRecognizer:)]; recognizer.edges = UIRectEdgeLeft; [self.view addGestureRecognizer:recognizer];
keyboardDismissMode:scrollView滚动时隐藏[b]键盘[/b]
self.scrollView.keyboardDismissMode =
UIScrollViewKeyboardDismissModeOnDrag;//刚拖动scrollView就隐藏键盘
self.scrollView.keyboardDismissMode =
UIScrollViewKeyboardDismissModeInteractive;//从键盘上面点(scrollView未遮挡部分)向下滑动,键盘会跟着滑动;又往上滑动键盘也会跟着向上滑动
UIScrollViewKeyboardDismissModeNone//默认值,没有任何影响
参考网址:http://www.objc.io/issue-5/iOS7-hidden-gems-and-workarounds.html
相关文章推荐
- iOS7 SDK各种坑——手Q团队总结
- 升级iOS7后利用rvictl和wireshark抓包失效?
- iOS7的一些总结:使用UIView的一种有效方法
- iOS7 edgesForExtendedLayout
- iOS6到iOS7的适配
- autolayout在iOS7下tableviewCell中使用出现的bug
- iOS开发-ios7下拉刷新,上提加载快速集成
- ios7和ios8下通过表格中的btn获取当前行数
- iOS7中弹簧式列表的制作
- 系统键盘在ios7 ios8上不同效果
- 网易公开课-iOS7应用开发-笔记-1-(1)
- iOS开发--修复iOS7以上自定义LeftBarbuttonItem后向右偏移
- 新手IOS tweak越狱app开发记录
- ios7 statusBar的字体颜色设置为白色
- ios7 ios8 cell中下划线偏移(separator Insets)处理方法
- 在iOS7中修改状态栏字体的颜色
- iOS7导航栏遮盖问题的解决
- iOS7隐藏状态栏 status Bar
- iOS7程序后台运行
- (七十五)CoreLocation(一)在iOS7和iOS8设备上获取授权