self.loginButton.layer.shadowOffset = CGSizeMake(0, 10);//阴影的大小,x往右和y往下是正
self.loginButton.layer.shadowColor = [UIColor blueColor].CGColor; //阴影的颜色
self.loginButton.layer.shadowOpacity = 0.5;//阴影的不透明度
self.loginButton.layer.shadowRadius = 5; ////阴影的扩散范围,相当于blur radius,也是shadow的渐变距离,从外围开始,往里渐变shadowRadius距离
self.loginButton.layer.masksToBounds =NO; //很重要的属性,可以用此属性来防止子元素大小溢出父元素,如若防止溢出,请设为 true
self.loginButton.layer.cornerRadius = 25;
网友评论