diff --git a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/UserInterfaceState.xcuserstate b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/UserInterfaceState.xcuserstate index c762307..08610e1 100644 Binary files a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/UserInterfaceState.xcuserstate and b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 09704fd..55249c6 100644 --- a/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/SwiftProject/SwiftProject.xcworkspace/xcuserdata/aaa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -46,8 +46,8 @@ filePath = "SwiftProject/Project/View/CCSpatialDisplayTypeView/CCSpatialDisplayTypeView.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "131" - endingLineNumber = "131" + startingLineNumber = "140" + endingLineNumber = "140" landmarkName = "init(menuWidth:arrow:datas:configures:dissMissCallback:)" landmarkType = "7"> @@ -664,5 +664,37 @@ landmarkType = "7"> + + + + + + + + diff --git a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialPhotoDisplayController/CCSpatialPhotoDisplayController.swift b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialPhotoDisplayController/CCSpatialPhotoDisplayController.swift index 123023a..e680411 100644 --- a/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialPhotoDisplayController/CCSpatialPhotoDisplayController.swift +++ b/SwiftProject/SwiftProject/Project/Controller/RecordingVideo/CCSpatialPhotoDisplayController/CCSpatialPhotoDisplayController.swift @@ -222,9 +222,14 @@ class CCSpatialPhotoDisplayController: BaseController { self.navtionBar?.isHidden = false mTopImgView.isHidden = false edBtn?.isHidden = false + menuView.isLandspaceScreen = false + + menuView.dismiss() break case .landscapeLeft , .landscapeRight: isLandscape = true + menuView.isLandspaceScreen = true + menuView.dismiss() print("Landscape ...") navtionBar?.snp.updateConstraints { make in make.top.equalToSuperview().offset(-30) @@ -245,6 +250,9 @@ class CCSpatialPhotoDisplayController: BaseController { default: print("Other") } + + let pointOnScreen = navtionImgView!.convert(CGPointMake(KScreenHeight*0.5, navtionImgView!.bottom), to: KWindow) + menuView.exUpdateArrowPointWithIsLandspace(pointOnScreen) } @@ -361,6 +369,12 @@ class CCSpatialPhotoDisplayController: BaseController { } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + KAppDelegate?.allowRotation = false + self.setNeedsUpdateOfSupportedInterfaceOrientations() + } + override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) let sec:TimeInterval = ZZHHelper.getSecFromUserDefaultByKey(kNowTimeToUserDefaultKey_PhotoDisplayController) diff --git a/SwiftProject/SwiftProject/Project/View/CCSpatialDisplayTypeView/CCSpatialDisplayTypeView.swift b/SwiftProject/SwiftProject/Project/View/CCSpatialDisplayTypeView/CCSpatialDisplayTypeView.swift index 2c4ee10..8156a87 100644 --- a/SwiftProject/SwiftProject/Project/View/CCSpatialDisplayTypeView/CCSpatialDisplayTypeView.swift +++ b/SwiftProject/SwiftProject/Project/View/CCSpatialDisplayTypeView/CCSpatialDisplayTypeView.swift @@ -72,7 +72,16 @@ public class CCSpatialDisplayTypeView: UIView { static let cellID:String = "CCSpatialDisplayTypeCellID" private var myFrame:CGRect! //tableview frame private var arrowView : UIView! = nil - + var isLandspaceScreen = false { + didSet{ + if isLandspaceScreen { + self.frame = CGRect(origin: .zero, size: CGSize(width: KScrH, height: KScrW)) + } + else{ + self.frame = UIScreen.main.bounds + } + } + } var tableView:UITableView! = nil var isShowing:Bool = false//是否为显示状态 @@ -163,6 +172,10 @@ public class CCSpatialDisplayTypeView: UIView { } + func exUpdateArrowPointWithIsLandspace(_ point:CGPoint) { + arrowPoint = point + } + required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -188,6 +201,8 @@ public class CCSpatialDisplayTypeView: UIView { } } + + //MARK: - 设置UI func initViews() { self.backgroundColor = UIColor.black.withAlphaComponent(popMenuOutAlpha) @@ -217,8 +232,8 @@ public class CCSpatialDisplayTypeView: UIView { tableView.delegate = self tableView.dataSource = self tableView.bounces = false - UIView.animate(withDuration: 0.3) { - self.addSubview(self.tableView) + UIView.animate(withDuration: 0.3) {[weak self] in + self?.addSubview((self?.tableView)!) } //展示【结束串流】和【开始串流】 @@ -238,14 +253,14 @@ public class CCSpatialDisplayTypeView: UIView { if arrowPoint.x <= popMenuMargin { arrowPoint.x = popMenuMargin } - if arrowPoint.x >= KScrW - popMenuMargin{ - arrowPoint.x = KScrW - popMenuMargin + if arrowPoint.x >= (isLandspaceScreen ? KScrH : KScrW) - popMenuMargin{ + arrowPoint.x = (isLandspaceScreen ? KScrH : KScrW) - popMenuMargin } var originalPoint = CGPoint.zero //箭头中间距离左边距离 var arrowMargin:CGFloat = popMenuMargin - if arrowPoint.x < KScrW/2{ + if arrowPoint.x < (isLandspaceScreen ? KScrH : KScrW)/2{ if (arrowPoint.x > myFrame.width/2) { arrowMargin = myFrame.width/2 originalPoint = CGPoint(x: arrowPoint.x - myFrame.width/2, y: arrowPoint.y+arrowViewHeight) @@ -256,9 +271,9 @@ public class CCSpatialDisplayTypeView: UIView { }else{ - if (KScrW-arrowPoint.x) < myFrame.width/2{ - arrowMargin = (myFrame.width - KScrW + arrowPoint.x ) - originalPoint = CGPoint(x: KScrW-popMenuMargin-myFrame.width, y: arrowPoint.y+arrowViewHeight) + if ((isLandspaceScreen ? KScrH : KScrW)-arrowPoint.x) < myFrame.width/2{ + arrowMargin = (myFrame.width - (isLandspaceScreen ? KScrH : KScrW) + arrowPoint.x ) + originalPoint = CGPoint(x: (isLandspaceScreen ? KScrH : KScrW)-popMenuMargin-myFrame.width, y: arrowPoint.y+arrowViewHeight) }else{