简体   繁体   English

自动布局和约束不起作用,Xcode中的按钮看起来与IOS SImulator中的按钮不同

[英]Autolayout and constraints not working, buttons look different in Xcode than they do in IOS SImulator

Both Xcode and the iPhone simulator are set to iPhone 6. The frames are updated. Xcode和iPhone模拟器都设置为iPhone6。框架已更新。 I even changed the simulated metrics under the attributes inspector to iPhone 5.5 inch screen. 我什至将属性检查器下的模拟指标更改为iPhone 5.5英寸屏幕。

I tried adding constraints for the width and height but received an error in Xcode every time I ran the simulator with them on so I took them off. 我尝试为宽度和高度添加约束,但是每次我在模拟器上运行它们时,在Xcode中都会收到一个错误,因此我将其取下。

This seems to happen a lot with buttons and labels. 按钮和标签似乎经常发生这种情况。 Been stumped for hours, researched all I could, finally decide to post it on here. 被困了几个小时,研究了我所能做的一切,最后决定将其张贴在这里。

I just joined so they won't let me post a pic of my problem because I don't have enough rep points. 我刚刚加入,所以他们不会让我发布我的问题的照片,因为我没有足够的代表积分。

iPhone 6s have the option when you first set them up to work in 'zoomed view' or normal view. 当您首次将它们设置为在“缩放视图”或普通视图下工作时,iPhone 6s会提供该选项。 if the iPhone is set up in display settings to be zoomed, then it will display as though the phone was iPhone 5/SE size, but zoomed in. you should always check your constraint's behavior on all screen sizes, and I'd also confirm if this is an issue by checking your devices' settings. 如果将iPhone设置为缩放显示设置,那么它将显示为iPhone 5 / SE尺寸,但放大了。您应该始终检查所有屏幕尺寸上的约束行为,并且我还要确认如果通过检查设备的设置来解决此问题。

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

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