gpt4 book ai didi

IOS DEV : Should I be concerned if the Main. Storyboard布局看起来与实际布局不同?

转载 作者:行者123 更新时间:2023-11-29 13:54:43 27 4
gpt4 key购买 nike

所以对于我的应用程序,当我点击运行时 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”右侧的黄色小箭头图标:

storyboard editor detail

该图标告诉您有一些问题需要解决。单击它,您将获得特定问题的列表以及解决这些问题的选项。

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com