将UIBezierPath添加到UILabel后,大小不会根据设备而改变吗?

我的代码

-(void)roundCornersWithCorner:(UIRectCorner)corners andRadius:(CGFloat)radius withView:(UILabel *)lable
{
CAShapelayer * maskLayer = [CAShapelayer layer];
maskLayer.path = [UIBezierPath bezierPathWithRoundedRect:lable.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(radius,radius)].CGPath;
lable.layer.mask = maskLayer;

[[lable layer] setShadowOffset:CGSizeMake(0,-2)];
[[lable layer] setShadowOpacity:0.5f];
[[lable layer] setShadowRadius:2.0f];

}

调用函数:

[self roundCornersWithCorner: UIRectCornerTopLeft | UIRectCornerTopRight andRadius:12 withView:myLabel];

将UIBezierPath添加到UILabel后,大小不会根据设备而改变吗?

这里的尾部空格比起前导的空格要多。

圆角图像的前导和尾随应相同。如何设置?

a22037181 回答:将UIBezierPath添加到UILabel后,大小不会根据设备而改变吗?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3162013.html

大家都在问