|
|
@@ -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;
|
|
|
|