【发布时间】:2015-07-29 10:04:16
【问题描述】:
您好,我的应用有一个纵向设计,我想在用户旋转设备时更改此设计。
类似的东西:
肖像:
按钮 1 - 按钮 2
按钮 3 - 按钮 4
风景:
按钮 1 - 按钮 2 - 按钮 3 - 按钮 4
不知道下一个方法是不是最好的:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
- (void) didRotate:(NSNotification *)notification{
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation == UIDeviceOrientationLandscapeLeft) {
HERE CHANGE THE CONSTRAINS
}
}
谢谢大家。
【问题讨论】:
标签: ios iphone landscape landscape-portrait portrait