简体   繁体   English

XCODE 6 - 标签不集中在不同的设备上

[英]XCODE 6 - Label not centralized on different devices

Maybe there is an answer on the StackOverflow, but i can find it! 也许StackOverflow上有答案,但我能找到它!

I have created a new project on Xcode 6 (deployment target for iOS 6+). 我在Xcode 6上创建了一个新项目(iOS 6+的部署目标)。 I have created a View Controller on the Storyboard and put a Label on that, but when i run the app on iPhone 6 emulator the label is not centralized, but on iPhone 4S it is! 我在故事板上创建了一个View Controller并在其上放置了一个Label,但是当我在iPhone 6模拟器上运行应用程序时,标签不是集中的,但在iPhone 4S上它是!

I have read a lot of people telling that now we need use Auto Layout with Constraints, but I have an old project on my work that works perfectly on iPhone 4S and iPhone 6 (the label's in this old app is centralized). 我已经阅读了很多人告诉我们现在我们需要使用带有约束的自动布局,但是我的工作中有一个旧项目在iPhone 4S和iPhone 6上完美运行(这个旧应用程序中的标签是集中的)。

Please, can anyone help me with this? 拜托,任何人都可以帮我吗?

Thanks! 谢谢!

Before the auto layout thing UIView 's property autoresizingMask can help automatically resize itself. 在自动布局之前, UIView的属性autoresizingMask可以帮助自动调整自身大小。 So if your UILabel 's autoresizingMask is UIViewAutoresizingFlexibleWidth and NSTextAlignment is NSTextAlignmentCenter the label in the old project may be centralized on both device 因此,如果你的UILabelautoresizingMaskUIViewAutoresizingFlexibleWidthNSTextAlignmentNSTextAlignmentCenter ,那么旧项目中的标签可能集中在两个设备上

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

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