您的位置:首页 > 移动开发 > IOS开发

ios 模态半透明弹出框

2016-03-18 14:00 429 查看
<span style="color:#FF0000;">1. didSelectRowAtIndexPath</span>

if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
detailVC.providesPresentationContextTransitionStyle = YES;
detailVC.definesPresentationContext = YES;
detailVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:detailVC animated:YES completion:^{

}];
}else
{
self.view.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:detailVC animated:YES completion:^{

}];
}
2.
self.view.backgroundColor = [UIColor clearColor];
UIView *alphaView = [[UIView alloc] initWithFrame:self.view.frame];
UIView *baseView = [[UIView alloc] initWithFrame:self.view.frame];
alphaView.backgroundColor = [UIColor clearColor];
baseView.backgroundColor = [UIColor blackColor];
baseView.alpha = 0.6;
[self.view addSubview:baseView];
[self.view addSubview:alphaView];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: