iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
babyname
V2EX  ›  iDev

当 translucent = false 时,如果高度不减去 navigationBar 的高度,则内容溢出?

  •  
  •   babyname · Jan 12, 2015 · 2566 views
    This topic created in 4154 days ago, the information mentioned may be changed or developed.
    navigationController?.navigationBar.translucent = false

    searchTableView = UITableView(frame: view.frame, style: UITableViewStyle.Grouped)
    searchTableView.frame.size.height -= 64 // 当 translucent = false 时,如果高度不减去navigationBar的高度,则内容溢出。

    当不设置 translucent 时,则内容刚好填满 view。
    2 replies    2015-01-24 19:54:52 +08:00
    LINAICAI
        1
    LINAICAI  
       Jan 12, 2015
    貌似,下面的代码可以解决溢出问题。
    //处理偏移问题
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
    [self setEdgesForExtendedLayout:UIRectEdgeNone];
    }
    Sunnyyoung
        2
    Sunnyyoung  
       Jan 24, 2015
    用Storyboard的话可以直接设置该View的Extends Edges,不用代码
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2573 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 466ea39e · 51ms · UTC 15:55 · PVG 23:55 · LAX 08:55 · JFK 11:55
    ♥ Do have faith in what you're doing.