1つまたは2つのUIViewコントローラを横向きモードで表示し、もう1つはPortraitで表示します。 この目的のために、AppDelegateでこの関数を実装しました。私は横向きを必要とするのUIViewController(S)でiOS9 supportedInterfaceOrientationsForWindowが呼び出されなくなる
@property (nonatomic, assign) UIInterfaceOrientationMask orientation;
:AppDelegate.hに、方位が
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return self.orientation;
}
。 、私は、しかし、このコードに
-(void)viewWillAppear:(BOOL)animated
{
self.appDelegate.orientation = UIInterfaceOrientationMaskLandscape;
}
と
-(void)viewWillDisappear:(BOOL)animated
{
self.appDelegate.orientation = UIInterfaceOrientationMaskPortrait;
}
を置いて、私は 'LandscapeViewController' に行くとき、それは大丈夫動作しますが、私は戻って、それは大丈夫動作しますが、私は再びそのOK 'LandscapeViewController' に行きますその後、私が戻ってくると、supportedInterfaceOrientationsForWindowメソッドが呼び出されなくなりました。その理由は何ですか?または私は変な何かをやっている?
はい、私はタブバーを使用していますあなたのビューコントローラでこれを配置します。 – Haris