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

添加禁止屏幕旋转

parent 4546457d
......@@ -8036,7 +8036,7 @@
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Test";
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
......@@ -8045,7 +8045,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -8181,7 +8182,7 @@
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Uat";
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
......@@ -8190,7 +8191,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -8397,7 +8399,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -8435,7 +8438,7 @@
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = galaxy/Res/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活";
INFOPLIST_KEY_CFBundleDisplayName = "银河港生活-Dev";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要您的同意,才能使用相机进行照片拍摄来完成信息填写,如禁止将无法拍摄照片,会影响资料提交效率。";
......@@ -8444,7 +8447,8 @@
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "APP需要您的同意,才能访问相册进行选择照片上传来完成信息填写,如禁止将无法上传选定图片,会影响资料提交效率。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
......
......@@ -21,19 +21,6 @@ import HyphenateChat
@main
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?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
......@@ -154,7 +141,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
}
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 {
......
......@@ -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 {
return self.gk_statusBarHidden
}
......@@ -123,3 +131,4 @@ class YHBaseViewController: UIViewController {
// return true
// }
//}
......@@ -20,6 +20,14 @@ class YHNavigationController: UINavigationController {
}
super.pushViewController(viewController, animated: animated)
}
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .landscapeLeft, .landscapeRight]
}
}
//extension YHNavigationController: UIGestureRecognizerDelegate {
......
......@@ -26,6 +26,14 @@ class YHTabBarViewController: ESTabBarController {
private var shareModel : TabBarShareModel?
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .landscapeLeft, .landscapeRight]
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
......
......@@ -93,14 +93,10 @@ class YHBasePlayerViewController: YHBaseViewController {
// MARK: - Orientation Support
extension YHBasePlayerViewController {
override var shouldAutorotate: Bool {
return true
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
return [.portrait, .landscapeLeft, .landscapeRight]
}
}
......@@ -11,7 +11,17 @@ import UIKit
class YHLiveAppointmentViewController: YHBaseViewController {
private let viewModel = YHLiveSalesViewModel()
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 = {
let view = UIImageView()
view.contentMode = .scaleAspectFit
......
......@@ -35,9 +35,12 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
private var originalX: CGFloat = 0
private var isMessageListHidden = false //默认展示
// MARK: - UI Components
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .all // 返回支持的方向
return [.portrait, .landscapeLeft, .landscapeRight]
}
private lazy var bottomInputBar: YHInputBottomBar = {
......@@ -358,6 +361,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
if !isLiveStateOn {
setupStateViewController()
}
changePortrait()
liveStateVC.setupData(liveDetail: liveDetail)
} else {
removeStateViewController()
......
......@@ -29,7 +29,17 @@ class YHLiveStateViewController: YHBaseViewController {
var messageLabel: UILabel!
var getCodeButton: UIButton!
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 = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 260))
view.isHidden = true
......
......@@ -23,7 +23,17 @@ class YHMessageInputViewController: UIViewController {
var inputCallback: ((YHMessageInputViewController, String) -> 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 = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 54))
view.backgroundColor = .white
......
......@@ -16,7 +16,17 @@ class YHVODPlayerViewController: YHBasePlayerViewController {
var startPosition: Int = 0
private let viewModel = YHLiveSalesViewModel()
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 = {
let view = YHVideoProgressControl()
return view
......
......@@ -2,16 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<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>
<array>
<dict>
......@@ -135,5 +125,9 @@
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>agc_applinking_not_read_pasteboard</key>
<false/>
</dict>
</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