简体   繁体   English

Xcode:自动布局无法正常工作

[英]Xcode: Autolayout not working correctly

I've got this weird bug in my application. 我的应用程序中有这个奇怪的错误。 When I load up my app on the simulator or an iDevice and I go to the pageControl page the layout is doing weird things. 当我在模拟器或iDevice上加载我的应用程序并转到pageControl页面时,布局正在做一些奇怪的事情。

I use the pagecontrol pages for a calendar view, so if I load it up I see this 我将pagecontrol页面用于日历视图,因此,如果加载它,我会看到

第一视角

That's all good, but when I scroll down (or up) the layout changes a bit 很好,但是当我向下(或向上)滚动时,布局会有所变化

滚动时

If the scrolling is done and I'm on the next page the layout readjust itself and is then in it's good state 如果滚动完成并且我在下一页上,则布局会重新调整自身,然后处于良好状态

第二页

So I don't know where this has gone wrong but of someone knows I would be very grateful! 所以我不知道哪里出了问题,但是有人知道我会非常感激! I'm using auto-layout in this page and on every simulator size I get this same problem. 我在此页面中使用自动布局,在每种模拟器尺寸下,我都会遇到同样的问题。

如果您使用自动布局来放置垂直线,那么我建议您将其位置设置在单元格左侧而不是标签右侧在单元格左侧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM