보기가 나타날 때 장치 방향을 알고 싶습니다. 이전에는 shouldAutorotateToInterfaceOrientation
메서드를 사용할 수 있었지만 IOS 6에서는 더 이상 사용되지 않습니다.보기가 나타날 때 장치 방향을 알고 싶습니다. IOS 6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation==UIInterfaceOrientationPortrait ||interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) {
DashBtn.hidden=NO;
}
else
{
DashBtn.hidden=YES;
if (self.popoverControllerMain) {
[self.popoverControllerMain dismissPopoverAnimated:YES];
}
}
return YES;
}
나는
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
이를 참조
의-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
대신 rootviewcontroller 및
- (BOOL)shouldAutorotate {
return NO;
}// this method is not called
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
하지만 ... 즉, 그것을 위해 장치를 – shyla
@shyla를 회전하지 않고 첫 번째보기를로드하면'코드 작성해야 할 때 늘 전화 - (무효) viewDidLoad' 또는'- (void) viewWillAppear : (BOOL) animated' –