|
@@ -137,8 +137,9 @@ typedef enum {
|
|
|
[self.parentViewController.view layoutIfNeeded];
|
|
[self.parentViewController.view layoutIfNeeded];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-- (void)viewDidLayoutSubviews {
|
|
|
|
|
- [super viewDidLayoutSubviews];
|
|
|
|
|
|
|
+
|
|
|
|
|
+- (void)viewWillLayoutSubviews {
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[self clearControlView];
|
|
[self clearControlView];
|
|
|
|
|
|
|
@@ -166,9 +167,10 @@ typedef enum {
|
|
|
|
|
|
|
|
[self initControl];
|
|
[self initControl];
|
|
|
|
|
|
|
|
- [self.view.superview layoutIfNeeded];
|
|
|
|
|
|
|
+ [self.view setNeedsDisplay];
|
|
|
|
|
|
|
|
self.pdfScrollView.scrollEnabled = YES;
|
|
self.pdfScrollView.scrollEnabled = YES;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)clearControlView {
|
|
- (void)clearControlView {
|
|
@@ -182,7 +184,7 @@ typedef enum {
|
|
|
- (void)rotateView {
|
|
- (void)rotateView {
|
|
|
|
|
|
|
|
|
|
|
|
|
- [self viewDidLayoutSubviews];
|
|
|
|
|
|
|
+ [self viewWillLayoutSubviews];
|
|
|
|
|
|
|
|
self.orientation = self.currentAppOrientation;
|
|
self.orientation = self.currentAppOrientation;
|
|
|
|
|
|
|
@@ -394,11 +396,13 @@ typedef enum {
|
|
|
if (self.presentedViewController) {
|
|
if (self.presentedViewController) {
|
|
|
[self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
|
|
[self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
|
|
|
}
|
|
}
|
|
|
- for (UIView * v in self.editControlView.subviews)
|
|
|
|
|
- {
|
|
|
|
|
- [v removeFromSuperview ];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
|
|
|
|
+ [self rotateView];// 在此重新布局使视图在旋转过程中减少卡顿,更自然。
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
{
|
|
{
|
|
|
|
|
|