UITabBarController 中的 UITableView 在旋转时向下移动 10 px
我在 UITabBarController 中有一个 UITableView,当 TableView 的起始方向是横向时没有问题,但是当起始方向是纵向时它会在旋转后向下移动 10 px,请参阅
旋转之前的图像:
旋转后:
灰色 10 像素矩形显示在 Status 和 UINavigationController 之间。
任何帮助将不胜感激。 谢谢大家。
I have a UITableView inside UITabBarController, when the starting orientation for the TableView is Landscape there is no problem, but when the Starting Orientation is Portrait it get shifted down by 10 px after rotating, please see Images,
Before Rotating:
After Rotating:
The gray 10 pixel rect is shown between the Status and the UINavigationController.
Any help would be so much appreciated.
Thanks all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在界面生成器中打开 XIB,单击表格视图,打开检查器,选择“视图大小”选项卡(左起第三个)。在“自动调整大小”(不是大小和位置)下,您将看到一个白色矩形,内部有一个黑色矩形,以及一堆箭头和线条,这些箭头和线条将影响视图对超级视图大小调整的反应(如果我错了,请纠正我)。基本上,尝试一下:)我可能是错的,但我认为在你的情况下,你应该选择两个自动调整大小箭头(小黑色矩形内的2)和顶部和左侧的线(在黑色矩形)。
Open the XIB in interface builder, click on the tableview, open the inspector, choose the View Size tab (third from the left). Under Autoresizing (not size and position) you will see a white rectangle, with a black rectangle inside, and bunch of arrows and lines that will effect that way the view reacts to resizing of the superview (correct me if i'm wrong). Basically, play around with those :) I might be wrong but i think that in your case, you should select both autoresizing arrows (the 2 inside the small black rectangle) and the lines to the top and to the left of it (outside of the black rectangle).
我已经找到了解决方案,但它似乎与我所面临的问题无关,但我尝试了一切,这终于完成了工作。
这是我以前所做的:
之前
我通过从 XIB 连接的 IBOutlet 加载我的 UITabController 并按如下方式加载:
现在
我从 XIB 中删除了我的 UITabViewController 并从应用程序委托中加载它,如下所示:
感谢大家努力。
I have found the solution, but it seems has nothing to do with what i was facing but i tried everything and this finally did the job.
Here what i used to do to:
Before
I used to load My UITabController through an IBOutlet connected from on XIB and load it as follow:
Now
I Removed my UITabViewController from the XIB and load it from the application delegate as follows:
Thanks all for the effort.