模态弹出全屏遮蔽

代码我用自己写的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

效果图,项目的效果图

项目效果图
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容