简体   繁体   English

模拟器与设备中的视图不一致

[英]Inconsistent view in simulator vs device

I am making an app of a calculator and I put a lot of buttons to the main view. 我正在制作一个计算器应用程序,并且在主视图中放置了许多按钮。 However, when I test it on a simulator, some of the buttons don't show up correctly. 但是,当我在模拟器上对其进行测试时,某些按钮无法正确显示。 Can anyone tell me what happens? 谁能告诉我会发生什么? I'm totally confused because I just drag buttons, labels, etc. from the toolbox in the right of the XCode and changed their fonts and aligned them to role and columns. 我完全感到困惑,因为我只是从XCode右侧的工具箱中拖动按钮,标签等,并更改了它们的字体并将它们与角色和列对齐。 I didn't do any programming things to buttons (except for adding IBActions and Outlets ). 我没有对按钮做任何编程操作(除了添加IBActionsOutlets )。 Here is a snapshot of my problem. 这是我的问题的快照。

快照

By the way, the colored rectangles are just textfields to store expressions and answers. 顺便说一下,彩色矩形只是用于存储表达式和答案的文本字段。 They will be transparent finally and are currently colored to show positions on the screen for convenience. 它们最终将是透明的,并且为了方便起见,当前已被着色以在屏幕上显示位置。

I can't give more details because I don't know anything about any possible reasons. 我无法提供更多详细信息,因为我对任何可能的原因一无所知。 After all, designing the view is just a drawing and aesthetic issue but I am stuck now. 毕竟,设计视图只是一个绘图和美学问题,但我现在陷入困境。 Can anyone give an explanation? 谁能解释一下?

So it turns out that I need to disable autolayout . 因此,事实证明我需要禁用autolayout With autolayout , I guess that XCode will optimize with autolayout option on. 使用autolayout ,我想XCode将在autolayout选项启用的情况下进行优化。 After turning it off, everything looks good. 将其关闭后,一切看起来都很好。

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

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