在ios开发过程中,时常会遇到一些需要遮罩层的效果,覆盖背景。如下是实现方法代码:
-(UIView *)backView{
if (!_backView) {
_backView = [[UIView alloc] init];
CGRect frame = self.view.frame;
if (!IOS7_OR_LATER) {
frame.origin.y -= 20;
frame.size.height +=20;
}
_backView.frame = frame;
_backView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
}
return _backView;
}
【云广告】:
本文章由网友发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!