ibireme / YYText

Powerful text framework for iOS to display and edit rich text.
MIT License
8.84k stars 1.67k forks source link

iOS16 创建YYTextView后 导致旋转屏幕失败 #973

Open q858333 opened 1 year ago

q858333 commented 1 year ago

UIWindowSceneGeometryPreferencesIOS geometryPreferences = [UIWindowSceneGeometryPreferencesIOS.alloc initWithInterfaceOrientations:1 << orientation]; [ws requestGeometryUpdateWithPreferences:geometryPreferences errorHandler:^(NSError _Nonnull error) { }];

创建YYTextView后,requestGeometryUpdateWithPreferences方法的block会返回错误

GKWenBo commented 1 year ago

@q858333 你好,请问这个问题解决了吗

teethandnail commented 1 year ago

YYText导致ioS16不能旋转,是因为YYTextEffectWindow这个单例window导致,在合适的时机把这个window设置成隐藏可以避免这个问题

WeeTom commented 1 year ago

找遍了屏幕旋转相关的代码,终于发现是这个问题。。。崩溃~有人解决了吗

WeeTom commented 1 year ago

我的问题是,App在特定场景允许横屏,但是大部分情况是不允许横屏的,加入YYTextView之后,应用界面没有横屏,但是手机状态栏可以横屏了

LatteCat commented 1 year ago

找遍了屏幕旋转相关的代码,终于发现是这个问题。。。崩溃~有人解决了吗

参考上面 @teethandnail 那位兄弟的解决方案啊