iOS 7 Table view fail to auto adjust content inset

前端 未结 7 1653
情话喂你
情话喂你 2020-12-04 14:24

I am transiting my project to iOS7. I am facing a strange problem related to the translucent navigation bar.

I have a view controller and it has a tableview as subv

7条回答
  •  悲哀的现实
    2020-12-04 15:15

    Yeah - a bit annoying.

    I have a nib with a single tableview within the main view, not using autolayout. There is a tabbar, navigationbar and a statusbar and the app needs to work back to 5.0. In Interface builder that neat 'see it in iOS7 and iOS6.1 side-by-side' thing works, showing the tables neatly fitting (once the iOS6/7 deltas were set properly).

    However running on a device or simulator there was a large gap at the top of the table, which was as a result of a content inset (which pretty much matched by iOS6/7 vertical delta) that was set to zero in the nib.

    Only solution I got was in viewWillAppear to put in [_tableView setContentInset:UIEdgeInsetsZero].

    Another ugly hack with a pretty on-screen result.....

提交回复
热议问题