imageDetailsScrollViewController.m 20 KB

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