打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
IOS8系统下,APP开发的不同,及碰到的问题收集,ios8app
 IOS8 Tabbar变蓝的情况, 已经自己摸索出来了 
 
      if (IOS7以上){ 
          self.tabBarItem= [[UITabBarItem alloc] initWithTitle:self.titleimage:[UIImage imageNamed:默认图片] selectedImage:[UIImageimageNamed:选择后图片]]; 
          self.tabBarItem.selectedImage= [self.tabBarItem.selectedImageimageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 
          self.tabBarItem.image= [self.tabBarItem.imageimageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 
 
       } 
       else{ 
          self.tabBarItem.image= [UIImage imageNamed:选择后图片]; 
          [self.tabBarItemsetFinishedSelectedImage:[UIImageimageNamed:选择后图片] 
                      withFinishedUnselectedImage:[UIImageimageNamed:默认图片]]; 
       } 
 
 
 
 
 
 
------------------------------------ 
2014/9/25   更新内容 
 
8.模态画面presentModelView背景变成非透明黑色  
目前已经解决,具体参照http://stackoverflow.com/questions/24158820/how-to-present-a-semi-transparent-half-cut-viewcontroller-in-ios-8  
 
2014/8/5更新内容 
1.iOS8_beta5更新后,存在电话Tel:变不好用的问题了。目前正在调查中。 
2.(严重问题)现在的ViewDidLoad的调用机制发生了变化,影响了时序 
 
------------------------------------ 
 
 
1.程序崩溃问题。 
   使用iOS8demo的系统运行iOS7下的程序,会发生程序崩溃的情况。通常这种崩溃的发生原因是变量对象被提前释放了 
   举例 
-(void)自定义函数 
{ 
ClassViewControllerA * classViewControllerA =[ [ClassViewControllerAalloc] init...]; (这么用生命周期会有问题) 
self presentView classViewControllerA; 
} 
最好是把classViewControllerA拿到@property里管理 
 
 
2.原来自定义的UIView的布局变大了 
通常这个View是作为Controller的self.view设置的,而且将View自定义了Size,iOS8demo中会无视这种自定义,强制设置为标准宽高。解决方式是需要重新设置View为FreeForm,或者程序中设置Frame。 
 
 
3.自定义UIActionSheet的SubView无法显示 
  就像UIAlert一样,UIActionSheet上也没有办法乱加东西了。 
 
 
4.子类中的属性名和父类里的冲突了。 
    iOS7前貌似没问题,iOS8beta不行了。举例 description字段,NSObject里也有 
 
 
5.地图定位不好用了 
地图的对应,目前在看这个苹果的pdf, 
https://developer.apple.com/jp/devcenter/ios/library/documentation/LocationAwarenessPG.pdf 
 iOS8修改了位置设置里的内容,增加了一套状态(使用中可用/通常可用),所以以前的CLLcationManage的注册后, 
Delegate接口不响应了。 
 iOS8需要这么设置 
第一步 
   location =[[CLLocationManager allocinit]; 
 
location.delegateself; 
[locationrequestAlwaysAuthorization]; 
第二步 
 
 
在Plist中追加下面两个字段 (必须有,最少一个,内容是系统ALert的文言,文言可为空) 
NSLocationWhenInUseDescriptionNSLocationAlwaysUsageDescription
第三步 
有了新的Delegate方法。 
- (void)locationManager:(CLLocationManager *)managerdidChangeAuthorizationStatus:(CLAuthorizationStatus)status 
{ 
   switch (status){ 
casekCLAuthorizationStatusNotDetermined: 
          if ([location respondsToSelector:@selector(requestAlwaysAuthorization)]){ 
[locationrequestAlwaysAuthorization]; 
          } 
          break; 
       default: 
          break; 
 
 
    } 
} 
附上调查过程 
https://developer.apple.com/jp/devcenter/ios/library/documentation/LocationAwarenessPG.pdf 
http://www.w3c.com.cn/ios8新特性之基于地理位置的消息通知uilocalnotification 
http://blog.uniba.jp/post/91830563468/ios-8 
 
 
 
6.BluetoothLE不好用了 
  确认了。5修正好以后,BLE就OK了 
 
 
7.自定义TabbarBar进入present或者HideBottomTabbar后,会变蓝 
    怀疑是IOS8demo问题 
   目前尝试用这个方法遮挡了一下,但是如果是自定义Tabbbar图片,图片只能显示白色剪影,内容无法显示。 [self.tabBarController.tabBar setSelectedImageTintColor:[UIColor whiteColor]]; 
 
8.模态画面presentModelView背景变成非透明黑色 
   > 怀疑是IOS8demo问题 
   > 目前iOS8 提出了一个新的Class但是貌似没用。 
目前已经解决,具体参照http://stackoverflow.com/questions/24158820/how-to-present-a-semi-transparent-half-cut-viewcontroller-in-ios-8 
 
9.UIAlertVIew中message过长的情况下,布局崩溃(iOS7允许内容滑动)。 
   >方法检讨中 
 >参考网页:http://www.cnblogs.com/nathanou/p/3778200.html 
    >※ iOS8 UIAlertView变化为UIAlertController   (和本问题无关) 
已经使用自定义画面实现了。 
 
 
10.Alert内字体变粗体的问题。 
 确认下你的UIAlert创建的地方。如果Title设置为nil,则message字体会变粗体。 
  如果Title设置为@“”,则不会变化。 
 

http://www.cocoachina.com/bbs/read.php?tid=217107&page=1&toread=1#tpc

1.UITableviewCell

 

内存不断增加。找了很久原因。后来一步一步的寻下去,发现是以下问题

- (void)layoutSubviews 

之前,因为IOS7设置了accessoryView后,contentView回被向前移动。为了让contentView位置不变,所以在该方法中,使用了

 

 

[super layoutSubviews];    // IOS8 开始,会引起循环。所以只在IOS8以前执行if (need) {            CGRect frmContentview = self.contentView.frame;            frmContentview.size.width = CGRectGetWidth(self.bounds);            self.contentView.frame = frmContentview;        }
所以很多使用这个的地方都会引起无限循环。因为改变了contentView的frame就会不断引起layoutSubviews方法。

 

解决方法:使用了self.contentView.superView。并且在

 

 

- (void)setSelected:(BOOL)selected animated:(BOOL)animated{    [super setSelected:selected animated:animated];    [self.contentView.superView setBackgroundColor:self.contentView.backgroundColor];    // Configure the view for the selected state}- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{    [super setHighlighted:highlighted animated:animated];    [self.contentView.superView setBackgroundColor:self.contentView.backgroundColor];}

这样颜色就比较统一了。其他的正常使用就可以了。

 

2.NSUserDefaults

这个东西真的很蛋疼。clean下项目,删除模拟器APP。重新运行后,

发现取到的BOOL值或都其他,基本都跟未删除时一样。经过google,最终找到IOS8的模拟器,如果删除了app,貌似NSUserDefaults是不会重置的。

所以,只有重新reset下模拟器。重试后发现,还真的是这么回事。真机还没有测试。

3.键盘。

不管是textField还是textView都可以看到光标在跳动。但是键盘就是不出来。

纠结了了1个多小时,找各种原因,google了很久。最后,在第2点重置后发现,恢复正常。瞬间无语

4.UIAlertView

UIAlertView如果设置title为nil。会发现字体变黑,设为@""就可以了

5.重名问题

新建了一个类继承自NSObject。并且声明了一个delegate的protocol。

结果,在使用的时候发现指向了NSFileManagerDelegate。

这个是因为在IOS8的SDK中,NSObject类存在一个delegate的声明。重名就改名,解决

6.UIScrollview

很多人在IOS6升级IOS7的时候应该碰到过UIScrollview不能滑动的问题。网上的方法都是这样的

在viewWillAppear 或者 viewDidAppear 中加入,

 

[self.tableview setContentOffset:CGPointMake(0, CGFLOAT_MAX)animated:YES];

但是在IOS8里面,发现这种话,也会引起界面卡死

所以大家可以使用以下方法解决

 

 

if (self.tableview.contentSize.height > self.tableview.bounds.size.height) {            [self.tableview setContentOffset:CGPointMake(0, self.tableview.contentSize.height) animated:YES];        }

7.BadgeNumber

更新APP徽标的时候,在IOS8中需要授权,否则可能出错。或提示

Attempting to badge the application icon but haven't receivedpermission from the user to badge the application

 

#ifdef SUPPORT_IOS8    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {        UIUserNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:myTypes categories:nil];        [[UIApplication sharedApplication] registerUserNotificationSettings:settings];    }else#endif    {        UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound;        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes];    }

SUPPORT—IOS8  

 

__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000



本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
uiviewController管理UITableView
制作一个可以滑动操作的 Table View Cell
iOS tableviewcell左划自定义(带图片)删除按钮,点击任意地方取消删除的巧妙实现方法
iOS仿热门话题热点轮播界面tableView
IOS研究成果
iOS7 UI改变总结
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服