Keyboard appears in wrong orientation in ios

前端 未结 4 1409
耶瑟儿~
耶瑟儿~ 2021-01-21 22:32

I have one viewcontroller in application that supports landscape and portrait orientations.

On a button click, a popup appears where I should enter the nam

4条回答
  •  遇见更好的自我
    2021-01-21 23:03

    Try by adding below code to your viewcontroller's viewDidAppear method

     - (void)viewDidAppear:(BOOL)animated
        {
            [super viewDidAppear:animated];
            [[UIDevice currentDevice] setValue:@(UIDeviceOrientationLandscapeLeft) forKey:@"orientation"];
            [[UIDevice currentDevice] setValue:@(self.interfaceOrientation) forKey:@"orientation"];
    
        }
    

提交回复
热议问题