몇 주 전에 간단한 해결책을 제안했습니다. 당신이 원하는 경우 , 당신은 세터를 호출해야이
RootViewController
@property (nonatomic, retain) BOOL autoRotate;
@property (nonatomic, retain) UIInterfaceOrientation interfaceOrientation;
-(void)setAutorate:(BOOL)newValue
{
_autoRotate = newValue;
}
-(void)setInterfaceOrientation: (UIInterfaceOrientation)newInterface
{
_interfaceOrientation = newInterface;
}
-(BOOL)shouldAutorotate
{
return _autoRotate;
}
-(UIInterfaceOrientation)supportedInterfaceOrientation
{
return _interfaceOrientation;
}
그리고 secondView의 컨트롤러를하고 두 번째 뷰 컨트롤러의 프리젠 테이션에 rootviewcontroller의 shouldAutoRotate/supportedInterfaceOrientation의 반환 값을 연결할 수 있습니다 메서드를 사용하여 값을 수정하십시오. 그런 다음 viewDidDisappear에서 또는 컨트롤러를 닫을 때 값을 다시 설정합니다.
- (BOOL) shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation) interfaceOrientation { return UIInterfaceOrientationIsPortrait (interfaceOrientation); } –
답장을 보내 주셔서 감사합니다.이 메서드는 @ SaurabhPrajapati – swetha