imageDetailsScrollViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. //
  2. // imageDetailsScrollViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/16.
  6. //
  7. #import "imageDetailsScrollViewController.h"
  8. #import <SDCycleScrollView/SDCycleScrollView.h>
  9. #import "editTypeBottomView.h"
  10. #import "editShareView.h"
  11. #import "NASFilePicModel.h"
  12. #import "uploadFileRecordViewController.h"
  13. #import "previewLandscapeTopView.h"
  14. #import "previewLandscapeTopMoreView.h"
  15. #import "UIInterface+HXRotation.h"
  16. @interface imageDetailsScrollViewController ()
  17. {
  18. NSMutableArray *imageURLStringsGroup;
  19. }
  20. @property (nonatomic,strong) SDCycleScrollView *curScrollView;
  21. @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
  22. @property(nonatomic,assign) BOOL isPortraitType;//竖屏状态
  23. @property(nonatomic,strong) previewLandscapeTopView*previewLandscapeTopV;
  24. @property(nonatomic,strong) previewLandscapeTopMoreView*previewLandscapeTopMoreV;
  25. @property(nonatomic,assign) BOOL isHideMsgType;//隐藏上下信息
  26. @end
  27. @implementation imageDetailsScrollViewController
  28. - (void)viewDidLoad {
  29. [super viewDidLoad];
  30. // Do any additional setup after loading the view.
  31. [self.toolBar setHidden:YES];
  32. [self.navigationBar setHidden:YES];
  33. [self.navBarBGView setHidden:NO];
  34. self.navBarBGView.backgroundColor = [UIColor clearColor];
  35. self.titleLabel.textColor = [UIColor whiteColor];
  36. [self.backBtn setImage:[UIImage imageNamed:@"icon_white_back"] forState:UIControlStateNormal];
  37. [self.view setBackgroundColor:[UIColor blackColor]];
  38. [self drawAnyView];
  39. _isPortraitType = YES;
  40. }
  41. - (void)drawAnyView
  42. {
  43. // gradient
  44. CAGradientLayer *gl = [CAGradientLayer layer];
  45. gl.frame = CGRectMake(0,0,SCREEN_W,60 + AdaptTabHeight);
  46. gl.startPoint = CGPointMake(0.5, 0);
  47. gl.endPoint = CGPointMake(0.5, 1);
  48. gl.colors = @[(__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.0].CGColor];
  49. gl.locations = @[@(0), @(1.0f)];
  50. //[self.layer addSublayer:gl];
  51. [self.navBarBGView.layer insertSublayer:gl atIndex:0];
  52. //横屏的头部
  53. _previewLandscapeTopV = [[previewLandscapeTopView alloc] init];
  54. [self.view addSubview:_previewLandscapeTopV];
  55. _previewLandscapeTopV.hidden = YES;
  56. [_previewLandscapeTopV mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.left.mas_equalTo(0);
  58. make.right.mas_equalTo(0);
  59. make.top.mas_equalTo(0);
  60. make.height.mas_equalTo(60);
  61. }];
  62. KWeakSelf
  63. _previewLandscapeTopV.didClickButton = ^(NSInteger tag) {
  64. [weakSelf didClickButInLandscapeTopFunBy:tag];
  65. };
  66. }
  67. - (void)viewDidAppear:(BOOL)animated
  68. {
  69. [super viewDidAppear:animated];
  70. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  71. ksharedAppDelegate.supportScreenRotateType = YES;
  72. //开始生成 设备旋转 通知
  73. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  74. //添加 设备旋转 通知
  75. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChange:) name:UIDeviceOrientationDidChangeNotification object:nil];
  76. }
  77. - (void)viewWillDisappear:(BOOL)animated {
  78. [super viewWillDisappear:animated];
  79. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent];
  80. ksharedAppDelegate.supportScreenRotateType = NO;
  81. //销毁 设备旋转 通知
  82. [[NSNotificationCenter defaultCenter] removeObserver:self
  83. name:UIDeviceOrientationDidChangeNotification
  84. object:nil];
  85. //结束 设备旋转通知
  86. [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
  87. }
  88. - (BOOL)shouldAutorotate {
  89. return YES;
  90. }
  91. /// 如果不好用则copy VC中 加一下
  92. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  93. return UIInterfaceOrientationMaskAllButUpsideDown;
  94. }
  95. /**屏幕旋转的通知回调*/
  96. - (void)orientChange:(NSNotification *)noti {
  97. UIDeviceOrientation orient = [UIDevice currentDevice].orientation;
  98. switch (orient) {
  99. case UIDeviceOrientationPortrait:
  100. NSLog(@"竖直屏幕");
  101. if(!_isPortraitType){
  102. [self screenLandscapeToPortraitFun];
  103. }
  104. break;
  105. case UIDeviceOrientationLandscapeLeft:
  106. NSLog(@"手机左转");
  107. if(_isPortraitType){
  108. [self screenPortraitToLandscapeFun];
  109. }
  110. break;
  111. case UIDeviceOrientationPortraitUpsideDown:
  112. // NSLog(@"手机竖直");
  113. break;
  114. case UIDeviceOrientationLandscapeRight:
  115. NSLog(@"手机右转");
  116. if(_isPortraitType){
  117. [self screenPortraitToLandscapeFun];
  118. }
  119. break;
  120. case UIDeviceOrientationUnknown:
  121. //NSLog(@"未知");
  122. break;
  123. case UIDeviceOrientationFaceUp:
  124. //NSLog(@"手机屏幕朝上");
  125. break;
  126. case UIDeviceOrientationFaceDown:
  127. //NSLog(@"手机屏幕朝下");
  128. break;
  129. default:
  130. break;
  131. }
  132. }
  133. #pragma mark 竖屏转横屏
  134. - (void)screenPortraitToLandscapeFun{
  135. _isPortraitType = NO;
  136. _curEditTypeBottomView.hidden = YES;
  137. self.navBarBGView.hidden = YES;
  138. _previewLandscapeTopV.hidden = NO;
  139. [self didClickScreenFun:NO];
  140. [_previewLandscapeTopV mas_remakeConstraints:^(MASConstraintMaker *make) {
  141. make.left.mas_equalTo(0);
  142. make.right.mas_equalTo(0);
  143. make.top.mas_equalTo(0);
  144. make.height.mas_equalTo(60);
  145. }];
  146. //[_curScrollView.mainView reloadData];
  147. //[_curScrollView adjustWhenControllerViewWillAppera];
  148. // if(_index >= 1){
  149. // [_curScrollView makeScrollViewScrollToIndex:_index-1];
  150. // [_curScrollView makeScrollViewScrollToIndex:_index];
  151. // }
  152. }
  153. #pragma mark 横屏转竖屏
  154. - (void)screenLandscapeToPortraitFun{
  155. _isPortraitType = YES;
  156. _curEditTypeBottomView.hidden = NO;
  157. self.navBarBGView.hidden = NO;
  158. _previewLandscapeTopV.hidden = YES;
  159. [self didClickScreenFun:NO];
  160. //[_curScrollView.mainView reloadData];
  161. //[self deletePreviewLandscapeTopMoreViewFun];
  162. // if(_index >= 1){
  163. // [_curScrollView makeScrollViewScrollToIndex:_index-1];
  164. // [_curScrollView makeScrollViewScrollToIndex:_index];
  165. // }
  166. }
  167. #pragma mark 用户点击分享
  168. - (void)gotoShareViewFun
  169. {
  170. editShareView *editShareV = [[editShareView alloc] init];
  171. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  172. editShareV.didSelectListArr = [NSMutableArray arrayWithArray:@[dataModel]];
  173. editShareV.shareFileType = @"2";
  174. [self.view addSubview:editShareV];
  175. [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
  176. make.left.mas_equalTo(0);
  177. make.right.mas_equalTo(0);
  178. make.bottom.mas_equalTo(0);
  179. make.top.mas_equalTo(0);
  180. }];
  181. }
  182. - (void)setTotalDataArr:(NSMutableArray *)totalDataArr
  183. {
  184. _totalDataArr = totalDataArr;
  185. imageURLStringsGroup = [NSMutableArray new];
  186. for (NASFilePicDataArrModel*dataModel in _totalDataArr) {
  187. NSString * URLString = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",ksharedAppDelegate.NASFileByBoxService,dataModel.path];
  188. URLString = [URLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  189. [imageURLStringsGroup addObject:URLString];
  190. }
  191. //HLog(@"URLString:\n%@",imageURLStringsGroup);
  192. _curScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero imageURLStringsGroup:imageURLStringsGroup];
  193. _curScrollView.autoScroll = NO;
  194. _curScrollView.infiniteLoop = NO;
  195. _curScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFit;
  196. //_curScrollView.placeholderImage = [UIImage imageNamed:@"uploadFile_image"];
  197. //[self.view addSubview:_curScrollView];
  198. [self.view insertSubview:_curScrollView belowSubview:self.navBarBGView];
  199. _curScrollView.backgroundColor = [UIColor blackColor];
  200. [_curScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  201. make.left.mas_equalTo(0);
  202. make.right.mas_equalTo(0);
  203. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(0);
  204. make.top.mas_equalTo(0);
  205. //make.bottom.mas_equalTo(-(60+ AdaptTabHeight));
  206. make.bottom.mas_equalTo(0);
  207. }];
  208. KWeakSelf
  209. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  210. [self->_curScrollView makeScrollViewScrollToIndex:self->_index];
  211. [weakSelf setTitleLabelTextFunBy:self->_index];
  212. [weakSelf cycleScrollViewDidScrollToIndex:self->_index];
  213. self->_curScrollView.hidden = NO;
  214. });
  215. _curScrollView.itemDidScrollOperationBlock = ^(NSInteger currentIndex) {
  216. weakSelf.index = currentIndex;
  217. [weakSelf setTitleLabelTextFunBy:currentIndex];
  218. [weakSelf cycleScrollViewDidScrollToIndex:currentIndex];
  219. };
  220. _curScrollView.clickItemOperationBlock = ^(NSInteger currentIndex) {
  221. self->_isHideMsgType = !self->_isHideMsgType;
  222. [weakSelf didClickScreenFun:self->_isHideMsgType];
  223. };
  224. _curEditTypeBottomView = [[editTypeBottomView alloc] init];
  225. _curEditTypeBottomView.isBlackType = YES;
  226. [self.view addSubview:_curEditTypeBottomView];
  227. //_curEditTypeBottomView.hidden = YES;
  228. [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
  229. make.left.mas_equalTo(0);
  230. make.right.mas_equalTo(0);
  231. make.bottom.mas_equalTo(0);
  232. make.height.mas_equalTo(60 + AdaptTabHeight);
  233. }];
  234. //KWeakSelf
  235. #pragma mark 编辑状态的 下载 分享 删除 响应事件
  236. _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
  237. if(tag==1){
  238. //[[iToast makeText:@"点击下载"] show];
  239. [weakSelf gotoDownLoadFileFun];
  240. }
  241. else if(tag==2){
  242. [weakSelf gotoShareViewFun];
  243. }
  244. else if(tag==3){
  245. //[[iToast makeText:@"点击删除"] show];
  246. [weakSelf showDeleteAlearViewFun];
  247. }
  248. };
  249. }
  250. - (void)setTitleLabelTextFunBy:(NSInteger)index
  251. {
  252. if(index >=0 && index < _totalDataArr.count){
  253. NASFilePicDataArrModel *dataModel = _totalDataArr[index];
  254. self.titleLabel.text = dataModel.name;
  255. _previewLandscapeTopV.titleLabel.text = dataModel.name;
  256. }
  257. }
  258. #pragma mark 删除图片
  259. - (void)showDeleteAlearViewFun
  260. {
  261. NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
  262. NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
  263. KWeakSelf
  264. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  265. msg:tipStr
  266. imageStr:nil
  267. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  268. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  269. didClickOk:^{
  270. [weakSelf delFileListFun];
  271. } didClickCancel:^{
  272. }];
  273. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  274. [self presentViewController:curAlretVC animated:YES completion:^{
  275. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  276. }];
  277. }
  278. #pragma mark 删除文件数据
  279. - (void)delFileListFun
  280. {
  281. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  282. if(_index >=0 && _index < _totalDataArr.count){
  283. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  284. NSArray *pathArr = @[dataModel.path];
  285. //NSArray *pathArr = @[dataModel.path,dataModel.path];
  286. [paraDict setValue:pathArr forKey:@"path"];
  287. }
  288. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  289. //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
  290. KWeakSelf //@"delFile"
  291. [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id _Nonnull responseObject) {
  292. [weakSelf removeNewIndicator];
  293. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  294. if(model && model.status == 0){
  295. [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
  296. if(weakSelf.didNeedToRegetDataFun){
  297. weakSelf.didNeedToRegetDataFun();
  298. }
  299. [weakSelf.navigationController popViewControllerAnimated:YES];
  300. }
  301. else{
  302. }
  303. } failure:^(NSError * _Nonnull error) {
  304. [weakSelf removeNewIndicator];
  305. }];
  306. }
  307. - (void)gotoDownLoadFileFun
  308. {
  309. if(_index >=0 && _index < _totalDataArr.count){
  310. NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
  311. couldPhoneFileModel* fileModel = [couldPhoneFileModel new];
  312. fileModel.fileType = @".jpg";
  313. fileModel.path = dataModel.path;
  314. fileModel.name = dataModel.name;
  315. fileModel.length = dataModel.size;
  316. NSMutableArray *arr = [NSMutableArray new];
  317. [arr addObject:fileModel];
  318. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  319. [self.navigationController pushViewController:vc animated:YES];
  320. vc.isDownloadingType = YES;
  321. [vc gotoDownloadFile:arr];
  322. }
  323. }
  324. - (void)setCanShareType:(BOOL)canShareType
  325. {
  326. _canShareType = canShareType;
  327. [_curEditTypeBottomView setCanShaewFunBy:canShareType];
  328. }
  329. #pragma mark 图片滑动
  330. - (void)cycleScrollViewDidScrollToIndex:(NSInteger)index{
  331. if(index >=0 && index < _totalDataArr.count){
  332. NASFilePicDataArrModel *dataModel = _totalDataArr[index];
  333. lastFileModel *lastFileMod = [lastFileModel new];
  334. lastFileMod.path = dataModel.path;
  335. lastFileMod.name = dataModel.name;
  336. lastFileMod.time = dataModel.time;
  337. lastFileMod.size = dataModel.size;
  338. lastFileMod.duration = dataModel.duration;
  339. lastFileMod.type = @"jpg";
  340. lastFileMod.lastPreTime = [iTools getNowTimeStamp];
  341. [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
  342. }
  343. }
  344. #pragma mark 横屏时点击顶部按钮
  345. - (void)didClickButInLandscapeTopFunBy:(NSInteger)tag
  346. {
  347. if(tag == 1){
  348. [self backBtnPressed];
  349. }
  350. else if(tag == 2){
  351. [self showPreviewLandscapeTopMoreViewFun];
  352. }
  353. else if(tag == 3){//分享
  354. [self gotoShareViewFun];
  355. }
  356. }
  357. #pragma mark 删除横屏的 more
  358. - (void)deletePreviewLandscapeTopMoreViewFun
  359. {
  360. [_previewLandscapeTopMoreV removeFromSuperview];
  361. _previewLandscapeTopMoreV = nil;
  362. }
  363. #pragma mark 点开了横屏的 more
  364. - (void)showPreviewLandscapeTopMoreViewFun
  365. {
  366. [self deletePreviewLandscapeTopMoreViewFun];
  367. _previewLandscapeTopMoreV = [[previewLandscapeTopMoreView alloc] init];
  368. [self.view addSubview:_previewLandscapeTopMoreV];
  369. [_previewLandscapeTopMoreV mas_makeConstraints:^(MASConstraintMaker *make) {
  370. make.left.mas_equalTo(0);
  371. make.right.mas_equalTo(0);
  372. make.top.mas_equalTo(0);
  373. make.bottom.mas_equalTo(0);
  374. }];
  375. KWeakSelf
  376. _previewLandscapeTopMoreV.didClickButtonFun = ^(NSInteger tag) {
  377. if(tag==10){
  378. //[[iToast makeText:@"点击下载"] show];
  379. //切换到竖屏
  380. [weakSelf hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
  381. [weakSelf screenLandscapeToPortraitFun];
  382. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  383. [weakSelf gotoDownLoadFileFun];
  384. });
  385. }
  386. else if(tag==11){
  387. //[[iToast makeText:@"点击删除"] show];
  388. [weakSelf showDeleteAlearViewFun];
  389. }
  390. };
  391. }
  392. #pragma mark 点开了屏幕
  393. - (void)didClickScreenFun:(BOOL)isHideMsgType
  394. {
  395. _isHideMsgType = isHideMsgType;
  396. if(isHideMsgType){//处理隐藏
  397. if(_isPortraitType){
  398. CGRect BottomViewRect = _curEditTypeBottomView.frame;
  399. CGRect fixBottomViewRect = CGRectMake(BottomViewRect.origin.x, BottomViewRect.origin.y + BottomViewRect.size.height, BottomViewRect.size.width, BottomViewRect.size.height);
  400. CGRect navBarBGViewRect = self.navBarBGView.frame;
  401. CGRect fixNavBarBGViewRect = CGRectMake(navBarBGViewRect.origin.x, navBarBGViewRect.origin.y - navBarBGViewRect.size.height, navBarBGViewRect.size.width, navBarBGViewRect.size.height);
  402. [UIView animateWithDuration:0.3 animations:^{
  403. self->_curEditTypeBottomView.frame = fixBottomViewRect;
  404. self.navBarBGView.frame = fixNavBarBGViewRect;
  405. } completion:^(BOOL finished) {
  406. self->_curEditTypeBottomView.hidden = YES;
  407. self.navBarBGView.hidden = YES;
  408. //frame 还原
  409. self->_curEditTypeBottomView.frame = BottomViewRect;
  410. self.navBarBGView.frame = navBarBGViewRect;
  411. }];
  412. }
  413. else{
  414. CGRect TopViewRect = _previewLandscapeTopV.frame;
  415. CGRect fixTopViewRect = CGRectMake(TopViewRect.origin.x, TopViewRect.origin.y - TopViewRect.size.height, TopViewRect.size.width, TopViewRect.size.height);
  416. [UIView animateWithDuration:0.3 animations:^{
  417. self->_previewLandscapeTopV.frame = fixTopViewRect;
  418. } completion:^(BOOL finished) {
  419. self->_previewLandscapeTopV.hidden = YES;
  420. //frame 还原
  421. self->_previewLandscapeTopV.frame = TopViewRect;
  422. }];
  423. }
  424. }
  425. else{//处理显示
  426. if(_isPortraitType){
  427. CGRect BottomViewRect = _curEditTypeBottomView.frame;
  428. CGRect fixBottomViewRect = CGRectMake(BottomViewRect.origin.x, BottomViewRect.origin.y + BottomViewRect.size.height, BottomViewRect.size.width, BottomViewRect.size.height);
  429. CGRect navBarBGViewRect = self.navBarBGView.frame;
  430. CGRect fixNavBarBGViewRect = CGRectMake(navBarBGViewRect.origin.x, navBarBGViewRect.origin.y - navBarBGViewRect.size.height, navBarBGViewRect.size.width, navBarBGViewRect.size.height);
  431. self->_curEditTypeBottomView.frame = fixBottomViewRect;
  432. self.navBarBGView.frame = fixNavBarBGViewRect;
  433. [UIView animateWithDuration:0.3 animations:^{
  434. //frame 还原
  435. self->_curEditTypeBottomView.frame = BottomViewRect;
  436. self.navBarBGView.frame = navBarBGViewRect;
  437. } completion:^(BOOL finished) {
  438. self->_curEditTypeBottomView.hidden = NO;
  439. self.navBarBGView.hidden = NO;
  440. }];
  441. }
  442. else{
  443. _previewLandscapeTopV.hidden = NO;
  444. CGRect topViewRect = _previewLandscapeTopV.frame;
  445. CGRect fixTopViewRect = CGRectMake(topViewRect.origin.x, topViewRect.origin.y - topViewRect.size.height, topViewRect.size.width, topViewRect.size.height);
  446. self->_previewLandscapeTopV.frame = fixTopViewRect;
  447. [UIView animateWithDuration:0.3 animations:^{
  448. //frame 还原
  449. self->_previewLandscapeTopV.frame = topViewRect;
  450. } completion:^(BOOL finished) {
  451. self->_previewLandscapeTopV.hidden = NO;
  452. }];
  453. }
  454. }
  455. }
  456. @end