how to set iOS 6/7 Deltas programmatically

前端 未结 4 1562
说谎
说谎 2021-02-19 16:14

I was developing a UISplitView app by using Xcode 4.6 when I left iOS6 I had design:

\"enter

相关标签:
4条回答
  • 2021-02-19 16:59

    If the view's embedded in a UINavigationController - simply untick "Translucent" for your root navigation bar.

    In storyboard, select Navigation Controller Scene, next select Navigation Bar and in Attributes Inspector (Utilities - 4 tab) untick "Translucent"

    0 讨论(0)
  • 2021-02-19 17:04

    In iOS 7 there are now extended edges, and that's why navigation bar overlaping the searchbar. You can set self.edgesForExtendedLayout = UIRectEdgeNone; this is UIVewControlelr property. You can also make checks depending on version of iOS and You can do things depending on current version of iOS in device.

    NSString *version = [[UIDevice currentDevice] systemVersion];
    int ver = [version intValue];
    if (ver < 7){
    //iOS 6 work
    }
    else{
    //iOS 7 related work
    }
    
    0 讨论(0)
  • 2021-02-19 17:16

    Also, you can use NSFoundationVersionNumber

    if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
      // > iOS7
    } else {
      // <= iOS6
    }
    
    0 讨论(0)
  • 2021-02-19 17:21

    You can create a makro for solve this problem. it is useful for me.

    #define iOS7Delta (([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ) ? 20 : 0 )
    
    0 讨论(0)
提交回复
热议问题