瀏覽代碼

1.修复PDF编辑页面在未完全显示时停止拖动,再进入该页面就不会生成Control控件。
2.修改Signature List在屏幕旋转时Dismiss。
3.修复屏幕旋转后下一个视图覆盖部分当前视图。

Pen Li 9 年之前
父節點
當前提交
d692d47e53

二進制
Ants Contract/AntsContract.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES" initialViewController="UmP-Fl-ZUI">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16A323" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES" initialViewController="UmP-Fl-ZUI">
     <device id="ipad9_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>

+ 2 - 0
Ants Contract/common/AppDelegate.m

@@ -465,6 +465,8 @@
 }
 
 - (void)heartBeatAction:(NSTimer *)timer {
+    // 离线状态下不发心跳包
+    if (self.accessMode == AppAccessModeOffline) return;
     
     __weak typeof(self) weakself = self;
     dispatch_async(dispatch_get_global_queue(0, 0), ^{

+ 3 - 0
Ants Contract/common/DocumentPageViewController.m

@@ -107,6 +107,9 @@
     //    self.delegate = self;
     //    self.dataSource = self;
     
+    // 修复初始化时视图向下偏移64点
+    UIView *v = [[UIView alloc] init];
+    [self.view insertSubview:v atIndex:0];
     
     self.signatureData= [[NSMutableDictionary alloc] init];
     

+ 3 - 0
Ants Contract/common/PageViewController.h

@@ -31,4 +31,7 @@
 -(void)EndEditing;
 @property (assign, nonatomic) long  tiv_index;
 @property (assign, nonatomic) bool  hide_control;
+
+- (void)rotateView;
+
 @end

+ 42 - 13
Ants Contract/common/PageViewController.m

@@ -34,7 +34,6 @@ typedef enum {
 @property (nonatomic,assign) ScreenOrientation orientation;
 @property (nonatomic,assign) ScreenOrientation currentAppOrientation;
 
-
 @end
 
 @implementation PageViewController
@@ -96,7 +95,7 @@ typedef enum {
 //
 //    [self.pdfPageView removeFromSuperview];
 //    [self.editControlView removeFromSuperview];
-    
+//    self.view.backgroundColor = [UIColor blueColor];
 }
 -(void)viewWillAppear:(BOOL)animated
 {
@@ -121,21 +120,27 @@ typedef enum {
     [super viewDidAppear:animated];
     if (self.orientation != ScreenOrientationUnknown) {
         if (self.orientation == self.currentAppOrientation) {
-            [self refreshControl];
+            // 修复未完全显示时停止拖动,再进入该页面就不会生成Control控件
+            if (self.editControlView.subviews.count) {
+                [self refreshControl];
+            } else {
+                [self initControl];
+            }
+            
+            
         } else {
             [self rotateView];
         }
     } else {
         [self initControl];
     }
+    [self.parentViewController.view layoutIfNeeded];
 }
 
-- (void)rotateView {
+- (void)viewDidLayoutSubviews {
+    [super viewDidLayoutSubviews];
     
-    for (UIView * v in self.editControlView.subviews)
-    {
-        [v removeFromSuperview ];
-    }
+    [self clearControlView];
     
     self.pdfScrollView.scrollEnabled = NO;
     // root
@@ -149,21 +154,42 @@ typedef enum {
     
     // pdf
     [self updateView:self.pdfPageView];
-//            NSLog(@"pdf page frame %@",[NSValue valueWithCGRect:self.pdfPageView.frame]);
+    //            NSLog(@"pdf page frame %@",[NSValue valueWithCGRect:self.pdfPageView.frame]);
     [self.pdfPageView setNeedsDisplay];
     
     // edit
     [self updateView:self.editControlView];
-
+    
     // contentSize
     self.pdfScrollView.contentSize = [self.pdfScrollView viewWithTag:1024].bounds.size;
     self.pdfScrollView.contentOffset = CGPointZero;
     
     [self initControl];
     
+    [self.view.superview layoutIfNeeded];
+    
     self.pdfScrollView.scrollEnabled = YES;
+}
+
+- (void)clearControlView {
+    for (UIView * v in self.editControlView.subviews)
+    {
+        [v removeFromSuperview ];
+    }
+
+}
+
+- (void)rotateView {
+
+    
+    [self viewDidLayoutSubviews];
     
     self.orientation = self.currentAppOrientation;
+    
+    for (UIViewController *vc in self.parentViewController.childViewControllers) {
+        [vc viewDidLayoutSubviews];
+    }
+    
 }
 
 - (void)updateView:(UIView *)view {
@@ -194,6 +220,7 @@ typedef enum {
     [self.hotTextView endEditing:true];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     self.orientation = self.currentAppOrientation;
+
 }
 -(void) dealloc
 {
@@ -364,6 +391,9 @@ typedef enum {
 }
 -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
 {
+    if (self.presentedViewController) {
+        [self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
+    }
     for (UIView * v in self.editControlView.subviews)
     {
         [v removeFromSuperview ];
@@ -371,11 +401,9 @@ typedef enum {
 }
 -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
 {
-    
 
     [self rotateView];
     
-
 //    [self initControl];
 ////    [self.pdfPageView setNeedsLayout];
 //    [self.pdfPageView setNeedsDisplay];
@@ -392,7 +420,7 @@ typedef enum {
 //    //        [self.collectionview.collectionViewLayout invalidateLayout];
 //    //        DebugLog(@"routed");
 //    //    }
-    
+//    
     
     
     
@@ -1509,6 +1537,7 @@ typedef enum {
         
     };
     
+    
     UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
     navi.modalPresentationStyle=UIModalPresentationPopover;