@@ -29,6 +29,7 @@ - (NSUInteger)autoResizeToFillScreen;
29
29
- (UIView *)topView ;
30
30
- (UIView *)underLeftView ;
31
31
- (UIView *)underRightView ;
32
+ - (void )adjustLayout ;
32
33
- (void )updateTopViewHorizontalCenterWithRecognizer : (UIPanGestureRecognizer *)recognizer ;
33
34
- (void )updateTopViewHorizontalCenter : (CGFloat)newHorizontalCenter ;
34
35
- (void )topViewHorizontalCenterWillChange : (CGFloat)newHorizontalCenter ;
@@ -176,8 +177,7 @@ - (void)viewDidLoad
176
177
- (void )viewWillAppear : (BOOL )animated
177
178
{
178
179
[super viewWillAppear: animated];
179
- [self updateUnderLeftLayout ];
180
- [self updateUnderRightLayout ];
180
+ [self adjustLayout ];
181
181
}
182
182
183
183
- (void )willAnimateRotationToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration
@@ -186,6 +186,17 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte
186
186
[self removeTopViewSnapshot ];
187
187
}
188
188
189
+ [self adjustLayout ];
190
+ }
191
+
192
+ - (void )didRotateFromInterfaceOrientation : (UIInterfaceOrientation)fromInterfaceOrientation {
193
+ if (![self topViewHasFocus ]){
194
+ [self addTopViewSnapshot ];
195
+ }
196
+ }
197
+
198
+ - (void )adjustLayout
199
+ {
189
200
if ([self underRightShowing ] && ![self topViewIsOffScreen ]) {
190
201
[self updateUnderRightLayout ];
191
202
[self updateTopViewHorizontalCenter: self .anchorLeftTopViewCenter];
@@ -201,12 +212,6 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte
201
212
}
202
213
}
203
214
204
- - (void )didRotateFromInterfaceOrientation : (UIInterfaceOrientation)fromInterfaceOrientation {
205
- if (![self topViewHasFocus ]){
206
- [self addTopViewSnapshot ];
207
- }
208
- }
209
-
210
215
- (void )updateTopViewHorizontalCenterWithRecognizer : (UIPanGestureRecognizer *)recognizer
211
216
{
212
217
CGPoint currentTouchPoint = [recognizer locationInView: self .view];
0 commit comments