1.所有的UIViewController加如下方法。

    - (void) viewDidLayoutSubviews {
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
            CGRect viewBounds = self.view.bounds;
            CGFloat topBarOffset = self.topLayoutGuide.length;
            viewBounds.origin.y = topBarOffset * -1;
            self.view.bounds = viewBounds;
            [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
        }
    }
在项目的plist文件里加View controller-based status bar appearance,值为no
 
 
2.scrollerView报错,找不到setAutomaticallyAdjustsScrollViewInsets:方法,解决方法
 
重写方法setAutomaticallyAdjustsScrollViewInsets:

- (void)setAutomaticallyAdjustsScrollViewInsets:(BOOL)automaticallyAdjustsScrollViewInsets

{

if(IS_IOS7){

[super setAutomaticallyAdjustsScrollViewInsets:automaticallyAdjustsScrollViewInsets];

}

}

然后viewDidLoad里面加上:
if([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]){
      self.automaticallyAdjustsScrollViewInsets = NO;
}
 

3.再做ios7兼容的时候最好让所有的UIViewController继承一个自己定义的UIViewController,然后好统一管理。

 
4.UITableView cell的分割线不能靠左的解决方法
添加一句:
[UITableViewappearance].separatorInset=UIEdgeInsetsZero;
 
5.适配IOS7时使用edgesForExtendedLayout遇到的问题
代码是navigationBar+tabBar组成的
在viewDidLoad里加了如下代码,
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
{
      self.edgesForExtendedLayout = UIRectEdgeNone;
      self.extendedLayoutIncludesOpaqueBars = NO;  
      self.modalPresentationCapturesStatusBarAppearance = NO;

self.navigationController.navigationBar.barTintColor =[UIColor grayColor];
      self.tabBarController.tabBar.barTintColor =[UIColor grayColor];
}

加了之后UI显示正常了,即没有上移20的高度。
问题是,当运行程序,自动进入到tabBar对应的第一个页面时,navigationBar和tabBar会出现黑色的背景,一小会会消失,才变成自己设置的背景色。
如果注释掉上面代码,进入程序时不会出现黑色背景,但是里面的UI会上移20的高度...

解决方法:

self.navigationController.navigationBar.translucent = NO;
        self.tabBarController.tabBar.translucent = NO;

 
 
 

copy from  http://blog.csdn.net/yongyinmg/article/details/23861853

IOS7 适配以及向下兼容问题的更多相关文章

  1. ios7适配一些问题以及64位32位

    ios7适配一些问题(http://www.cocoachina.com/ios/20130703/6526.html) 1.iOS应用如何实现64位的支持 http://www.codeceo.co ...

  2. 谈谈项目中遇到的各种iOS7适配问题

    由于我的项目要适配到iOS7.1, 而现在已经是9时代了,在实际工作中我也是遇到了各种奇葩的坑,所以我想尽快把遇到的iOS7适配问题和解决方案分享出来,以后这些东西可能就用处不大了. 1.字体问题 i ...

  3. iOS7适配问题

    iOS7适配问题 2013-09-28 08:32:37     我来说两句      作者:冻僵的企鹅 收藏    我要投稿 iOS 7发布了,适配问题来了,开发者都忙起来了. 先记一个iOS7 的 ...

  4. IOS 6和 IOS7适配的一些问题

    由于在做一个ios的通用设计平台,那么客户端解析的时候就涉及到一些ios不同版本,不同分辨率的适配问题 首先碰到的就是navigation bar中的item的背景色的问题 在ios7中设置setti ...

  5. iOS7适配之设计篇

    (注:文章简要翻译自 Apple <iOS 7 UI Transition Guide>,由于该文档为开发者预览版,并非最终文档,所以 iOS7 正式上线可能有部分不同) 准备工作 iOS ...

  6. IOS7适配

    (1)如果应用程序始终隐藏 status bar 那么恭喜呢,你在UI上需要的改动很少很少. (2)如果应用程序显示status bar,可以讲status bar设置成黑色不透明 ,然后在UIVie ...

  7. IOS7 适配时导航栏变黑

    当适配IOS的布局时遇到问题:导航栏和菜单栏后台会变黑色. self.edgesForExtendedLayout = UIRectEdgeNone; 原因是系统默认这两个控件是半通明的. 解决方案: ...

  8. ios7 适配

    1.状态栏20px高度问题 ) { [application setStatusBarStyle:UIStatusBarStyleLightContent]; self.window.clipsToB ...

  9. ios7适配--uitableviewcell选中效果

    ios7 UITableViewCell selectionStyle won't go back to blue up vote6down votefavorite 2 Xcode 5.0, iOS ...

随机推荐

  1. beanUtils操作bean的属性

    beanUtils操纵bean属性: 需要jar包commons-beanutils-x.x.x.jar    同时commons-beanutils-x.x.x.jar需要commons-loggi ...

  2. cocos2d-x中的CCScrollView滑动体验不佳

    在最近的项目中,使用了Cocos2d-x (2.2.0版本)提供的CCScrollView来拖动一个比较大的画面,但是发现滑动体验非常不佳, 手指离开屏幕后,滑动没有惯性,一个不算太大的画面,要滑动好 ...

  3. Could not load type System.ServiceModel.Activation.HttpModule解决办法

    等注册完成后网站就可以打开了. win2008下提示未能从程序集“System.ServiceModel, Version=3.0.0.0问题解决 在Windows Server 2008中的IIS服 ...

  4. 10min系列之二日志可视化进阶

    10min系列之二日志可视化进阶(作者原创,同步发布在github) 本文需要有一定的python和前端基础,如果没基础的,请关注我后续的基础教程系列博客 本文所有的demo,都是浏览器下展示的 原创 ...

  5. cocos2dx 随机函数

    cocos2dx 随机数  2.2.3版本 1.初始化时设定随机数种子,只需一次. time_t now = time(NULL); srand((unsigned int)now); 2.需要的时候 ...

  6. C++的二进制兼容问题(以QT为例)

    二进制不兼容带来的问题(需要重新编译库文件,以前编译的失效): http://my.oschina.net/lieefu/blog/505363?fromerr=f5jn7rct 二进制不兼容的原理: ...

  7. zookeeper 同步

    <pre name="code" class="html">一个节点上的数据发生变化后,通知其他节点 server 1: [root@wx03 bi ...

  8. BZOJ 2016: [Usaco2010]Chocolate Eating

    题目 2016: [Usaco2010]Chocolate Eating Time Limit: 10 Sec  Memory Limit: 162 MB Description 贝西从大牛那里收到了 ...

  9. apache添加fastcgi支持

    A,安装apache服务器和fastcgi模块支持(ubuntu测试) sudo apt-get install apache2 sudo apt-get install libapache2-mod ...

  10. STL之使用vector排序

    应用场景: 在内存中维持一个有序的vector: // VectorSort.cpp : Defines the entry point for the console application. #i ...