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. C++ 字符串分割,分割到vector中

    #include <string> #include <vector> using std::string; using std::vector; int splitStrin ...

  2. PHP自练项目之数字分页效果

    学习要点:1.LIMIT 用法2.各种参数3.超链接调用 第一:先在文件中设置数字分页模块:我的文件是(blog.php) //分页模块 $_page = $_GET['page']; $_pages ...

  3. this function has none of deterministic, no sql,or reads sql data in its declaration and binary logging is enabled

      原址:http://blog.chinaunix.net/uid-20639775-id-3031821.html   This function has none of DETERMINISTI ...

  4. Githut Token (hidden): Githut 安装验证

    登录https://github.com 进入https://github.com/settings/profile 参考 http://jingyan.baidu.com/article/22fe7 ...

  5. wireshark 包分析命令

    1.查看原地址过滤包命令: ip.src ==192.168.1.1 2.查看目的地址过滤包:ip.dst == 192.168.1.1 3.关键字 eq 等于 "==" ,and ...

  6. C语言(2)--数据类型

    C语言中提供多种不同的数据类型,用以存放不同的数据. 1.常见的基本类型有:int-->整型 float-->浮点型 double-->双精度浮点型 char-->字符型 NO ...

  7. Nginx 的 Echo 模块 —— echo-nginx-module(转)

    Nginx 有个 echo 模块可以用来输出一些简单的信息,例如: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 ...

  8. cocos2d-x删除vs2010项目模板

    假设你切换cocos2d-x版本号的话. 要将之前版本号的vs模板删除掉.方法例如以下: 进入下面文件夹(依据自己的vs版本号): VS2008: C:\Program Files\Microsoft ...

  9. android api 中文 (74)—— AdapterView.AdapterContextMenuInfo

    前言 本章内容是android.widget.AdapterView.AdapterContextMenuInfo,版本为Android 2.3 r1,翻译来自"cnmahj",欢 ...

  10. python 之 yield表达式

    如果在某个函数中包含了yield, 这意味着这个函数已经是一个Generator, 它的执行 会和其他普通的函数有很多不同. 比如: def   h(): print    'To   be  bra ...