WZLBadge icon indicating copy to clipboard operation
WZLBadge copied to clipboard

带数字的小红点不圆,被切割了

Open AlleniCode opened this issue 7 years ago • 10 comments

badgeFont = [UIFont systemFontOfSize:12]; 这样的圆点好像被切割了一点,变得不圆了

AlleniCode avatar Aug 28 '17 02:08 AlleniCode

我看在 目前没收到这个反馈

发自网易邮箱大师 在2017年08月28日 10:36,AlleniCode 写道:

badgeFont = [UIFont systemFontOfSize:12]; 这样的圆点好像被切割了一点,变得不圆了

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

weng1250 avatar Aug 28 '17 04:08 weng1250

模拟器分辨率不够导致的渲染问题吧, 和代码没关系, CMD + 1 看看园不圆

luyud avatar Aug 28 '17 08:08 luyud

真机调试的,改成这样badgeFont = [UIFont systemFontOfSize:11];就没有问题,应该不是渲染问题吧

AlleniCode avatar Aug 28 '17 09:08 AlleniCode

@AlleniCode 我这样设置没问题,字体大小无关

[self.rightBarItem setBadgeFont:[UIFont systemFontOfSize:6]]

luyud avatar Aug 30 '17 01:08 luyud

@LuYu001 你把字体设置的大一点试试呢?12+的字号试一下

AlleniCode avatar Aug 30 '17 10:08 AlleniCode

把你的不圆的截图上来看看呗

发自我的 iPhone

在 2017年8月30日,18:29,AlleniCode [email protected] 写道:

@LuYu001 你把字体设置的大一点试试呢?12+的字号试一下

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

luyud avatar Aug 30 '17 10:08 luyud

@LuYu001 @weng1250 12 2x 13 2x 14 2x 15 2x

1、第一张: badgeFrame = CGRectMake(0, 0, 18, 18); badgeCenterOffset = CGPointMake(3, -3); badgeFont = [UIFont systemFontOfSize:12];

2、第二张: badgeFrame = CGRectMake(0, 0, 18, 18); badgeCenterOffset = CGPointMake(3, -3); badgeFont = [UIFont systemFontOfSize:13];

3、第三张: badgeFrame = CGRectMake(0, 0, 18, 18); badgeCenterOffset = CGPointMake(3, -3); badgeFont = [UIFont systemFontOfSize:14];

4、第四张: badgeFrame = CGRectMake(0, 0, 18, 18); badgeCenterOffset = CGPointMake(3, -3); badgeFont = [UIFont systemFontOfSize:15];

发现12号字和14号字有切边不圆,而13号字和15号字正常。

AlleniCode avatar Aug 31 '17 02:08 AlleniCode

@AlleniCode 看上去就是渲染问题啊,换个分辨率高些的设备看看吧, 我这么写没有发现, 作者削圆的方法也很简单,就是 layer.cornerRadius = view.height,1位数的情况下不可能不圆的。

[_header.btn1 setBadgeFont:[UIFont systemFontOfSize:14]];
 [_header.btn1  showBadgeWithStyle:WBadgeStyleNumber value:3 animationType:WBadgeAnimTypeNone];

btw, 并不建议手动设置 frame, 并且没有任何意义,还可能导致别的问题

@property (nonatomic, assign) CGRect badgeFrame;                    /* we have optimized the badge frame and center.
                                                                        This property is adviced not to set manually */

luyud avatar Aug 31 '17 03:08 luyud

@LuYu001 我去掉badgeFrame的设置,也是一样的,不知道哪里出了问题。。。

AlleniCode avatar Aug 31 '17 03:08 AlleniCode

@AlleniCode 请问你解决这个问题了么,我也遇到了

blmyself avatar Feb 23 '20 14:02 blmyself