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. If We Were a Child Again

    Description The Problem The first project for the poor student was to make a calculator that can jus ...

  2. ANTLR3

    ANother Tool for Language Recognition start...

  3. jquery获取多个checkbox的值异步提交给php

    html代码: <tr> <td><input type="checkbox" name="uid" value="&l ...

  4. yield return in C#

    Yield has two great uses It helps to provide custom iteration with out creating temp collections. It ...

  5. [转]iOS多线程编程之NSThread的使用

    1.简介: 1.1 iOS有三种多线程编程的技术,分别是: 1..NSThread 2.Cocoa NSOperation (iOS多线程编程之NSOperation和NSOperationQueue ...

  6. BEANUTIL 对象转JSON

    package cn.com.softmap.cache.util; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutp ...

  7. Hibernate 知识点复习

    核心接口 1  Configuration接口负责配置并启动Hibernate,创建SessionFactory对象 2  SessionFactory接口负责初始化Hibernate.它充当数据存储 ...

  8. android 之Fragment(官网资料翻译)

    原文地址: http://blog.csdn.net/lilu_leo/article/details/7671533 ***************************  正文分割线 ***** ...

  9. 都div在所有li的html()值被设置&quot;哈哈&quot;,当点击设置&quot;我被点击&quot;,其余的还是不点击设置“哈哈”

    <1> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w ...

  10. 4种Java引用浅解

    近期研究Java Cache实现,发现使用到了软引用(SoftReference),不太理解,查阅了JDK文档.代码以及几篇文章.做个小结,如有错误,欢迎指正. 之所以想学习一下Java的几种引用类型 ...