我有一个带标签栏的应用程序,每个标签中都有导航控制器.当用户摇动设备时,UIImageView在导航控制器中显示为子视图.但UIImageView必须包含特殊图像,具体取决于设备的当前方向.
如果我写的只是
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)
if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
//Code
}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight||interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
//Code
}
}
Run Code Online (Sandbox Code Playgroud)
如果用户在摇动前旋转设备,视图就会变得疯狂.
有没有办法让iPhone出现当前定位?