给UIView添加阴影不起作用的解决办法

来源:互联网 发布:剑三dbm数据网盘 编辑:程序博客网 时间:2024/09/21 09:22

    self.layer.shadowColor = [UIColorblackColor].CGColor;

    self.layer.shadowOpacity =0.8f;

    self.layer.shadowRadius =4.f;

    self.layer.shadowOffset =CGSizeMake(4,4);

    self.layer.cornerRadius =self.layer.frame.size.height /2;

//    self.layer.masksToBounds = YES; //不能加maskToBounds 否则阴影被切