- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以对于我的应用程序,当我点击运行时 iOS 模拟器中的 tableview 布局是正确的并且符合我的预期。然而,当我在 Main.storyboard 中查看 tableview 的布局时,布局并不总是 100% 相同。当我刷新 Xcode(即退出并重新启动应用程序)时,Main.storyboard 的布局就是我想要的。但是,如果我在 Main.storyboard 中使用 orientations/diff iOS 设备,然后返回到我的原始设备,布局看起来不正确(即使据说数学/测量是正确的)。我需要担心吗?
作为引用,我遵循了 https://www.ralfebert.de/ios-examples/uikit/uitableviewcontroller/custom-cells/ 的说明完全是为了制作一个单元格(而不是图像,不过我使用了一个按钮)。这是我的 iPad 模拟器的图像 https://drive.google.com/file/d/152scJF6h12amh-AAycDqpe6TXOzN2y-H/view?usp=sharing对比 main.storyboard 模拟器 https://drive.google.com/file/d/1NvUfMVLk08S8qH4mFraRsQYbDzPdjaBG/view?usp=sharing
最佳答案
However the layout is not always 100% the same when I view the layout of the tableview in Main.storyboard.
听起来您可能缺少或不正确的约束。看一下“View Controller Scene”右侧的黄色小箭头图标:
该图标告诉您有一些问题需要解决。单击它,您将获得特定问题的列表以及解决这些问题的选项。
Do I need to be concerned?
当然,风险在于在某些情况下您的 View 不会按照您希望的方式绘制。首先修复 Xcode 指出的问题,然后尽可能在许多不同的设备(或模拟器)上测试您可能遇到的所有可能的几何形状(不同的屏幕尺寸、方向、 Split View等)。
关于IOS DEV : Should I be concerned if the Main. Storyboard布局看起来与实际布局不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57246175/
我是一名优秀的程序员,十分优秀!