imageDetailsScrollViewController.m 20 KB

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