181,加遮罩和将所需要的控件移到遮罩前面

来源:互联网 发布:南宁关键字优化公司 编辑:程序博客网 时间:2024/06/05 07:34

@property (nonatomic,strong)UIButton *cover;


-(UIButton *)cover{

    if (_cover ==nil) {

        _cover = [[UIButtonalloc]initWithFrame:self.view.bounds];

        _cover.backgroundColor = [UIColorcolorWithWhite:0alpha:0.5];

        _cover.alpha =0;

        [self.viewaddSubview:_cover];

        [_cover addTarget:selfaction:@selector(changeIconSize:)

         forControlEvents:UIControlEventTouchUpInside];

    }

    return _cover;

}


- (IBAction)changeIconSize:(UIButton *)sender {

    //遮罩点击事件的内容

}


//showIcon控件移到最前面

[self.viewbringSubviewToFront:self.showIcon];

0 0
原创粉丝点击