orientation change test

This commit is contained in:
True Zhuanjia committed 2024-07-12 21:13:19 +08:00
1 parent a5b1cd6c99
commit 06aa772a02
3 files changed
+10 -3

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@ import Foundation
import UIKit
class OrientationHelper {
static func updateOrientationToLandscape() {
@objc class OrientationHelper: NSObject {
@objc static func updateOrientationToLandscape() {
if #available(iOS 16.0, *) {
// 调用此方法会使视图控制器重新评估其支持的方向集。
UIApplication.shared.keyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()