Commit 426cd1d4 authored by pete谢兆麟's avatar pete谢兆麟

添加禁止屏幕旋转

parent 4546457d
...@@ -8036,7 +8036,7 @@ ...@@ -8036,7 +8036,7 @@
); );
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist; INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Test"; INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES; INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。"; INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
...@@ -8045,7 +8045,8 @@ ...@@ -8045,7 +8045,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -8181,7 +8182,7 @@ ...@@ -8181,7 +8182,7 @@
); );
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist; INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Uat"; INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES; INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。"; INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
...@@ -8190,7 +8191,8 @@ ...@@ -8190,7 +8191,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -8397,7 +8399,8 @@ ...@@ -8397,7 +8399,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -8435,7 +8438,7 @@ ...@@ -8435,7 +8438,7 @@
); );
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist; INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活"; INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES; INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。"; INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
...@@ -8444,7 +8447,8 @@ ...@@ -8444,7 +8447,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
......
...@@ -21,19 +21,6 @@ import HyphenateChat ...@@ -21,19 +21,6 @@ import HyphenateChat
@main @main
class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
var blockRotation: UIInterfaceOrientationMask = .portrait{
didSet{
if blockRotation.contains(.portrait){
//强制设置成竖屏
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
} else {
//强制设置成横屏
UIDevice.current.setValue(UIInterfaceOrientation.landscapeLeft.rawValue, forKey: "orientation")
}
}
}
var window: UIWindow? var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...@@ -154,7 +141,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -154,7 +141,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
} }
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return .all let vc = UIViewController.current ?? UIViewController()
if vc.isKind(of: YHLivePlayerViewController.self) {
return [.portrait, .landscapeRight]
}
return .portrait
} }
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
......
...@@ -35,6 +35,14 @@ class YHBaseViewController: UIViewController { ...@@ -35,6 +35,14 @@ class YHBaseViewController: UIViewController {
} }
} }
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .landscapeLeft, .landscapeRight]
}
override var prefersStatusBarHidden: Bool { override var prefersStatusBarHidden: Bool {
return self.gk_statusBarHidden return self.gk_statusBarHidden
} }
...@@ -123,3 +131,4 @@ class YHBaseViewController: UIViewController { ...@@ -123,3 +131,4 @@ class YHBaseViewController: UIViewController {
// return true // return true
// } // }
//} //}
...@@ -20,6 +20,14 @@ class YHNavigationController: UINavigationController { ...@@ -20,6 +20,14 @@ class YHNavigationController: UINavigationController {
} }
super.pushViewController(viewController, animated: animated) super.pushViewController(viewController, animated: animated)
} }
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .landscapeLeft, .landscapeRight]
}
} }
//extension YHNavigationController: UIGestureRecognizerDelegate { //extension YHNavigationController: UIGestureRecognizerDelegate {
......
...@@ -26,6 +26,14 @@ class YHTabBarViewController: ESTabBarController { ...@@ -26,6 +26,14 @@ class YHTabBarViewController: ESTabBarController {
private var shareModel : TabBarShareModel? private var shareModel : TabBarShareModel?
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .landscapeLeft, .landscapeRight]
}
override func viewDidLayoutSubviews() { override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews() super.viewDidLayoutSubviews()
......
...@@ -93,14 +93,10 @@ class YHBasePlayerViewController: YHBaseViewController { ...@@ -93,14 +93,10 @@ class YHBasePlayerViewController: YHBaseViewController {
// MARK: - Orientation Support // MARK: - Orientation Support
extension YHBasePlayerViewController { extension YHBasePlayerViewController {
override var shouldAutorotate: Bool { override var shouldAutorotate: Bool {
return true return false
} }
override var supportedInterfaceOrientations: UIInterfaceOrientationMask { override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown return [.portrait, .landscapeLeft, .landscapeRight]
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
} }
} }
...@@ -11,7 +11,17 @@ import UIKit ...@@ -11,7 +11,17 @@ import UIKit
class YHLiveAppointmentViewController: YHBaseViewController { class YHLiveAppointmentViewController: YHBaseViewController {
private let viewModel = YHLiveSalesViewModel() private let viewModel = YHLiveSalesViewModel()
private var liveInfo: YHShareLiveInfoModel? private var liveInfo: YHShareLiveInfoModel?
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
private lazy var topImageView: UIImageView = { private lazy var topImageView: UIImageView = {
let view = UIImageView() let view = UIImageView()
view.contentMode = .scaleAspectFit view.contentMode = .scaleAspectFit
......
...@@ -35,9 +35,12 @@ class YHLivePlayerViewController: YHBasePlayerViewController { ...@@ -35,9 +35,12 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
private var originalX: CGFloat = 0 private var originalX: CGFloat = 0
private var isMessageListHidden = false //默认展示 private var isMessageListHidden = false //默认展示
// MARK: - UI Components override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask { override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .all // 返回支持的方向 return [.portrait, .landscapeLeft, .landscapeRight]
} }
private lazy var bottomInputBar: YHInputBottomBar = { private lazy var bottomInputBar: YHInputBottomBar = {
...@@ -358,6 +361,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController { ...@@ -358,6 +361,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
if !isLiveStateOn { if !isLiveStateOn {
setupStateViewController() setupStateViewController()
} }
changePortrait()
liveStateVC.setupData(liveDetail: liveDetail) liveStateVC.setupData(liveDetail: liveDetail)
} else { } else {
removeStateViewController() removeStateViewController()
......
...@@ -29,7 +29,17 @@ class YHLiveStateViewController: YHBaseViewController { ...@@ -29,7 +29,17 @@ class YHLiveStateViewController: YHBaseViewController {
var messageLabel: UILabel! var messageLabel: UILabel!
var getCodeButton: UIButton! var getCodeButton: UIButton!
var state: YHLiveState = .start var state: YHLiveState = .start
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
private lazy var bottomView: UIView = { private lazy var bottomView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 260)) let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 260))
view.isHidden = true view.isHidden = true
......
...@@ -23,7 +23,17 @@ class YHMessageInputViewController: UIViewController { ...@@ -23,7 +23,17 @@ class YHMessageInputViewController: UIViewController {
var inputCallback: ((YHMessageInputViewController, String) -> Void)? var inputCallback: ((YHMessageInputViewController, String) -> Void)?
var closeCallback: (() -> Void)? var closeCallback: (() -> Void)?
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
private lazy var inputMainView: UIView = { private lazy var inputMainView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 54)) let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 54))
view.backgroundColor = .white view.backgroundColor = .white
......
...@@ -16,7 +16,17 @@ class YHVODPlayerViewController: YHBasePlayerViewController { ...@@ -16,7 +16,17 @@ class YHVODPlayerViewController: YHBasePlayerViewController {
var startPosition: Int = 0 var startPosition: Int = 0
private let viewModel = YHLiveSalesViewModel() private let viewModel = YHLiveSalesViewModel()
private var goodsListView: YHLiveShopView? private var goodsListView: YHLiveShopView?
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
private lazy var progressControl: YHVideoProgressControl = { private lazy var progressControl: YHVideoProgressControl = {
let view = YHVideoProgressControl() let view = YHVideoProgressControl()
return view return view
......
...@@ -2,16 +2,6 @@ ...@@ -2,16 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>agc_applinking_not_read_pasteboard</key>
<false/>
<key>CFBundleDocumentTypes</key> <key>CFBundleDocumentTypes</key>
<array> <array>
<dict> <dict>
...@@ -135,5 +125,9 @@ ...@@ -135,5 +125,9 @@
</array> </array>
<key>UIFileSharingEnabled</key> <key>UIFileSharingEnabled</key>
<true/> <true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>agc_applinking_not_read_pasteboard</key>
<false/>
</dict> </dict>
</plist> </plist>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment