简体   繁体   English

自动版式不起作用?

[英]Autolayout doesn't work?

So I'm creating my app in storyboard, and i'm using an navigation controller, added an add view, and trying to auto layout stuff there. 因此,我在情节提要中创建了我的应用程序,并使用了导航控制器,添加了添加视图,并尝试在此处自动布局内容。

But the problem is, i only get blue guided lines when I'm near the corner left and right. 但是问题是,当我左右拐角处时,我只会得到蓝色引导线。 So it's basically not looking at my Navigationbar above.. and just ignoring it. 因此,它基本上不是在看我上面的导航栏。而是忽略了它。

Also, when I'm switching the simulator to a 3.5 inch (I'm making it in 4 inch) the buttons and labels will disappear underneath it. 同样,当我将模拟器切换为3.5英寸(我将其制作为4英寸)时,按钮和标签也会消失在其下方。 And they are added to Auto layout blue lines? 并将它们添加到自动布局蓝线吗?

顶部没有蓝线。

The blue lines are not AutoLayout, but just lines that guide you when placing your views. 蓝线不是“自动布局”,而只是在放置视图时引导您的线。 Auto Layout only comes in when you start adding constraints. 自动布局仅在您开始添加约束时才出现。 Check out Apple's Autolayout guide: 查看Apple的自动版式指南:

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html

Control drag from the label to the navigation bar and it will show the below window. 控制从label拖动到navigation bar ,它将显示以下窗口。 The first option is for you to create the constraint from the Navigation Bar bottom. 第一个选项是让您从导航栏底部创建约束。

在此处输入图片说明

The Top Layout Guide is a iOS 7 specific feature which marks the bottom line of the navigation bar. Top Layout Guide是iOS 7的特定功能,它标记了导航栏的底行。 The total height of the navigation bar (if present) plus the height of the status bar (if present) equals the toplayoutGuide.length 导航栏的总高度(如果有)加上状态栏的高度(如果有)等于toplayoutGuide.length

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

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