Created
June 19, 2020 06:34
-
-
Save SunXiaoShan/cea3ea0c89c5158631160b6058dfefa4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
[self addBottomSheetView]; | |
} | |
- (void)addBottomSheetView { | |
BottomSheetViewController *bottomSheetVc = [BottomSheetViewController new]; | |
[self addChildViewController:bottomSheetVc]; | |
[self.view addSubview:bottomSheetVc.view]; | |
[bottomSheetVc didMoveToParentViewController:self]; | |
const CGFloat y = self.view.frame.origin.y; | |
const CGFloat height = self.view.frame.size.height; | |
const CGFloat width = self.view.frame.size.width; | |
bottomSheetVc.view.frame = CGRectMake( 0, y + height, width, height); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment