代码我用自己写的demo代码,效果是我的项目效果
#RootViewController.h中
// Copyright © 2016年 糖糖. All rights reserved.
//
#import "ViewController.h"
#import "ShareController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"测试";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"模态弹出全屏" style:UIBarButtonItemStyleDone target:self action:@selector(ActionShare)];
}
- (void)ActionShare{
ShareController *lagerPicVC = [[ShareController alloc]init];
// 这里面有很多枚举值,你可以去试试 lagerPicVC.modalPresentationStyle=UIModalPresentationOverFullScreen;;//关键语句,必须有
[self presentViewController:lagerPicVC animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
ShareController.m中
// Copyright © 2016年 糖糖. All rights reserved.
//
#import "ShareController.h"
@interface ShareController ()
@end
@implementation ShareController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:0.5];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
效果图,项目的效果图