从A页面到B页面使用 [A presentViewController:B animated:YES completion:nil];进行跳转时设置跳转方式
方式1:在A页面的跳转的地方使用
B.modalPresentationStyle = UIModalPresentationFullScreen;
方式2:在B页面使用:
- (UIModalPresentationStyle)modalPresentationStyle {
return UIModalPresentationFullScreen; }
备注:modalPresentationStyle相关的style
typedef NS_ENUM(NSInteger, UIModalPresentationStyle) {
UIModalPresentationFullScreen =0,
UIModalPresentationPageSheetAPI_AVAILABLE(ios(3.2))API_UNAVAILABLE(tvos),
UIModalPresentationFormSheetAPI_AVAILABLE(ios(3.2))API_UNAVAILABLE(tvos),
UIModalPresentationCurrentContextAPI_AVAILABLE(ios(3.2)),
UIModalPresentationCustomAPI_AVAILABLE(ios(7.0)),
UIModalPresentationOverFullScreenAPI_AVAILABLE(ios(8.0)),
UIModalPresentationOverCurrentContextAPI_AVAILABLE(ios(8.0)),
UIModalPresentationPopoverAPI_AVAILABLE(ios(8.0))API_UNAVAILABLE(tvos),
UIModalPresentationBlurOverFullScreenAPI_AVAILABLE(tvos(11.0))API_UNAVAILABLE(ios)API_UNAVAILABLE(watchos),
UIModalPresentationNoneAPI_AVAILABLE(ios(7.0)) = -1,
UIModalPresentationAutomaticAPI_AVAILABLE(ios(13.0)) = -2,
};
网友评论