【发布时间】:2016-06-06 10:56:32
【问题描述】:
这是我在使用 .XIB 文件创建的 uibutton 上添加阴影的代码
UIBezierPath *shadowPathEndbtn = [UIBezierPath bezierPathWithRect:CGRectMake(0, self->_navigationView.frame.size.height - 70,[UIScreen mainScreen].bounds.size.width , 2)];
self->_EndButton.layer.masksToBounds = NO;
self->_EndButton.layer.shadowColor = [UIColor blackColor].CGColor;
self->_EndButton.layer.shadowOffset = CGSizeMake(0.0f, 5.0f);
self->_EndButton.layer.shadowOpacity = 0.7f;
self->_EndButton.layer.shouldRasterize = YES;
self->_EndButton.layer.shadowPath = shadowPathForEndbtn.CGPath;
我可以使用此代码设置阴影,但此代码使我的按钮文本看起来模糊。我无法弄清楚这背后的确切原因。任何帮助表示赞赏!
【问题讨论】:
标签: ios objective-c iphone uibutton uibezierpath