Skip to content

Commit

Permalink
update example.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeathWang committed May 7, 2020
1 parent 1e19419 commit d5b9aa6
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions Demo/PanControllerExample/Base/HWBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@ - (void)viewDidLoad {
#pragma mark - HWPanModalPresentable

- (PanModalHeight)shortFormHeight {
if ([self isLandScape]) {
return [self longFormHeight];
}
return PanModalHeightMake(PanModalHeightTypeContent, 200.00001);
}

- (PanModalHeight)longFormHeight {
return PanModalHeightMake(PanModalHeightTypeMax, 0);
}

// 当转屏且为横屏时,为全屏幕模式。
- (CGFloat)topOffset {
if ([self isLandScape]) {
return 0;
} else {
return 40;
}
return self.topLayoutOffset;
}

- (BOOL)anchorModalToLongForm {
Expand All @@ -52,11 +47,7 @@ - (UIViewAnimationOptions)transitionAnimationOptions {
return UIViewAnimationOptionCurveLinear;
}

- (BOOL)isLandScape {
if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight ||
[UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) {
return YES;
}
- (BOOL)showDragIndicator {
return NO;
}

Expand Down

0 comments on commit d5b9aa6

Please sign in to comment.