iOS随记

模态弹出一个半透明页面

2016-08-25  本文已影响23人  valiant_xin

InputViewController *vc = [[InputViewController alloc] init];

self.definesPresentationContext = YES;//这个必须要

vc.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.4];

vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;

[self presentViewController:vc animated:YES completion:nil];

模态弹出一个半透明页面,可以看到上一个页面的内容,弹出来的界面不需要做特殊处理。一般用于点击按钮进行回复。

上一篇 下一篇

猜你喜欢

热点阅读