[英]iOS 7 Height of TableView increase Under TabBar
Im trying port my app to iOS7, but the height of my TableView increases in ios 7 while it is correct in ios 6. Due to which last row (cell) is almost half under the tab bar. 我尝试将我的应用程序移植到iOS7,但我的TableView的高度在ios 7中增加,而在ios 6中是正确的。由于最后一行(单元格)几乎是标签栏下面的一半。
Im searching a lot for it, but i dont find any solution. 我正在寻找它,但我没有找到任何解决方案。 Can anyone help me?
谁能帮我?
Open Storyboard, in Utilities of your UIViewController open "Attributes inspector" 打开Storyboard,在UIViewController的Utilities中打开“Attributes inspector”
"Under Top Bars" is ticked? 勾选“顶栏下”?
Have a look at iOS 7 UI Transition Guide 看看iOS 7 UI Transition Guide
if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
Use edgesForExtendedLayout
to specify which edges of a view should be extended, regardless of bar translucency. 使用
edgesForExtendedLayout
指定视图的哪些边应该扩展,而不管条形半透明。 By default, the value of this property is UIRectEdgeAll
. 默认情况下,此属性的值为
UIRectEdgeAll
。
if ([self respondsToSelector:@selector(extendedLayoutIncludesOpaqueBars)]) {
self.extendedLayoutIncludesOpaqueBars = NO;
}
If your design uses opaque bars, refine edgesForExtendedLayout
by also setting the extendedLayoutIncludesOpaqueBars
property to NO
. 如果您的设计使用不透明条形,
edgesForExtendedLayout
通过将extendedLayoutIncludesOpaqueBars
属性设置为NO
来细化edgesForExtendedLayout
。
if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {
self.automaticallyAdjustsScrollViewInsets = NO;
}
If you don't want a scroll view's content insets to be automatically adjusted, set automaticallyAdjustsScrollViewInsets
to NO
. 如果您不希望自动调整滚动视图的内容插入,请将
automaticallyAdjustsScrollViewInsets
设置为NO
。
You can also set topLayoutGuide
and bottomLayoutGuide
. 您还可以设置
topLayoutGuide
和bottomLayoutGuide
。 They indicate the location of the top or bottom bar edges in a view controller's view. 它们在视图控制器的视图中指示顶部或底部条边的位置。 If bars should overlap the top or bottom of a view, you can use Interface Builder to position the view relative to the bar by creating constraints to the bottom of
topLayoutGuide
or to the top of bottomLayoutGuide
. 如果条形图应与视图的顶部或底部重叠,则可以使用Interface Builder通过在
topLayoutGuide
底部或bottomLayoutGuide
顶部创建约束来相对于条形定位视图。
Moreover, you can also make adjustments in Interface builder. 此外,您还可以在“界面”构建器中进行调整。
And if you are not using autolayout, you can set the deltas for iOS6/7. 如果您不使用autolayout,则可以设置iOS6 / 7的增量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.