简体   繁体   English

自动布局和iPhone 6/6 Plus放错位置

[英]Autolayout and iPhone 6 / 6 Plus misplacements

This is strange and I don't find the cause... I have a view inside of another view, and I've set constraints for the child view to leading, top, trailing and bottom spaces to its parent view. 这很奇怪,我找不到原因...我在另一个视图中有一个视图,并且我已将子视图的约束条件设置为其父视图的前导,顶部,尾部和底部空间。 I see this view correctly in iPhone 5, but in iPhone 6 the inner view does not keep the trailing constraint and "goes partially out" of the screen... why could thi be happening? 我在iPhone 5中可以正确看到此视图,但是在iPhone 6中,内部视图不能保持尾随约束并“部分退出”屏幕...为什么会发生这种情况?

EDIT: This is the view configuration in storyboard: 编辑:这是情节提要中的视图配置:

在此处输入图片说明

the view at the back is a UIImageView that I've pin to leading, top, trailing and bottom of the superview. 后面的视图是一个UIImageView ,我将其固定到超级视图的开头,顶部,结尾和底部。 The interesting thing id the container: there I embed another view controller with its own view. 有趣的是,该容器位于容器中:我在其中嵌入了另一个具有自己视图的视图控制器。 Such view seems to take the room of the container when I run in iPhone 5, but in iPhone 6 the content of such container goes partially away to the right side of the screen... 当我在iPhone 5中运行时,这种视图似乎占据了容器的空间,但是在iPhone 6中,这种容器的内容部分移到了屏幕的右侧...

删除Center-X和Proportional宽度约束,并替换为前导约束和尾随约束。

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

相关问题 在iphone 6 plus上自动布局的意外结果 - Unexpected result for autolayout on iphone 6 plus iPhone 6和6 Plus的AutoLayout TableView问题 - AutoLayout TableView issue with iPhone 6 and 6 Plus 自动布局仅在iPhone 7 plus中不起作用 - Autolayout not working only in iPhone 7 plus Autolayout限制不适用于iPhone 6和6 Plus - Autolayout constraints not working iPhone 6 and 6 Plus iOS 8 AutoLayout滚动视图在iPhone 6 plus上水平滚动 - iOS 8 AutoLayout scrollview scrolls horizontally on iPhone 6 plus 通过设备尺寸调整iOS自动布局字体(iPhone 6 plus,iPhone 6,iPhone 5) - iOS Autolayout font adjustment with device size (iPhone 6 plus, iPhone 6, iPhone 5) Autolayout center x alignment在iPhone 6 Plus上产生无限的布局循环 - Autolayout center x alignment resulting in infinite layout loop on iPhone 6 Plus 创建特定于iPhone Six Plus的UI元素(最好使用Autolayout) - Create iPhone Six Plus-Specific UI Elements (preferably with Autolayout) 使用iPhone6和6Plus进行缩放显示的Autolayout问题 - Autolayout issue with zoomed display with iPhone6 and 6Plus 旋转期间 UISplitViewController 和 UISearchController 的 iPhone 6 Plus Autolayout 问题 - iPhone 6 Plus Autolayout issue with UISplitViewController and UISearchController during rotation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM