BaseShareViewController *vc = [[BaseShareViewController alloc] init];
以下是必要配置,
[vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
self.providesPresentationContextTransitionStyle = YES;
self.definesPresentationContext = YES;
[self.navigationController presentViewController:vc animated:YES completion:^{
}];
另外,还要在layout方法里面给模态出的页面设置大小,如图
- (void) viewWillLayoutSubviews
{
self.view.frame = CGRectMake(0, 500, MainScreenSize.width, 167);
}
最后实现的效果如下图:
未完待续。。。
网友评论