如何通过宏检测设备模型?我曾经使用过这样的东西但模拟器上的结果总是IS_IPHONE_5
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
#define IS_IPHONE_6PLUS (IS_IPHONE && [[UIScreen mainScreen] nativeScale] == 3.0f)
#define IS_IPHONE_6_PLUS (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0)
#define IS_RETINA ([[UIScreen mainScreen] scale] == 2.0)
Run Code Online (Sandbox Code Playgroud) 这是我的故事板

我正在使用autolayout,而不是使用大小类.
当我在iPhone 5s上运行时,它运行正常.(纵向和横向)

但是当我在iPhone 6 plus(肖像)上运行它时,它没有正确对齐.

在iPhone 6 plus(风景)上,情况更糟.

我知道我可以使用-widgetMarginInsetsForProposedMarginInsets:设置边距,但在这种情况下,我需要为每个设备自定义边距.那太可怕了:(
那么有没有办法将子视图与标题对齐不那么痛苦?