【问题标题】:IOS16 portrait rotate issueIOS16 portrait rotate issue
【发布时间】:2022-12-01 20:53:26
【问题描述】:

Hi I wanna fix the bug which occur in IOS16 for rotation screen I refer to this article, but it's still not working....

BTW we used the Object-c instead of Swift

Reference

    UIWindowScene  *windowScene  = ( UIWindowScene  *)[[[ UIApplication sharedApplication] connectedScenes]      allObjects].firstObject;
     UIWindowSceneGeometryPreferencesIOS  *perference  = [[ UIWindowSceneGeometryPreferencesIOS alloc]  init];
    perference.interfaceOrientations  =  1  < deviceOrientation;
    [windowScene requestGeometryUpdateWithPreferences:perference errorHandler: ^( NSError  * _Nonnull error) {
         NSLog(@ "error--%@", error);
    }];

【问题讨论】:

    标签: rotation screen portrait ios16


    【解决方案1】:

    Calling

     self.setNeedsUpdateOfSupportedInterfaceOrientations()
    

    before requesting the geometry update fixes it for me.

    【讨论】:

      猜你喜欢
      • 2022-08-24
      • 1970-01-01
      • 1970-01-01
      • 2022-11-10
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-27
      • 2017-01-04
      相关资源
      最近更新 更多