UIVisualEffectView實現“彈出”提示

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        UIVisualEffectView *bgView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
        bgView.alpha = 0.9f;
        bgView.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
        bgView.layer.cornerRadius = BALL_RADIUS / 2;
        bgView.clipsToBounds = YES;
        [self addSubview:bgView];
    }
    return self;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章