Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当设置未选中和选中字体不一致且选中标签title过长显示有问题 #509

Closed
wxw962530118 opened this issue Apr 23, 2024 · 2 comments

Comments

@wxw962530118
Copy link

bug描述
当设置普通和未选中字体不一致且选中标签title过长显示有问题

版本号
1.JXCategoryView版本号:1.6.3
2.手机系统版本号:17.4
3.手机型号:iPhone15 Pro

复现步骤

  1. 使用的类是:JXCategoryTitleView
    2.具体的操作步骤:使用的官方Demo,只是把titleFont和titleSelectedFont分别设置成[UIFont systemFontOfSize:14]和[UIFont systemFontOfSize:18 weight:UIFontWeightBold]就会出现截图所示问题,看了一下源码,计算cell宽度的时候用的是titleFont而并不是titleSelectedFont

截图
Simulator Screenshot - iPhone 15 Pro - 2024-04-23 at 11 10 41

@wxw962530118 wxw962530118 changed the title 当设置普通和未选中字体不一致且选中标签title过长显示有问题 当设置未选中和选中字体不一致且选中标签title过长显示有问题 Apr 23, 2024
@pujiaxin33
Copy link
Owner

可以参考【大小缩放+Cell宽度缩放】示例,同步把cell大小也给变大。
JXCategoryTitleView *titleCategoryView = (JXCategoryTitleView *)testVC.categoryView;
titleCategoryView.titleColorGradientEnabled = YES;
titleCategoryView.titleLabelZoomEnabled = YES;
titleCategoryView.titleLabelZoomScale = 1.3;
titleCategoryView.titleLabelStrokeWidthEnabled = YES;
titleCategoryView.selectedAnimationEnabled = YES;
titleCategoryView.cellWidthZoomEnabled = YES;
titleCategoryView.cellWidthZoomScale = 1.3;

@wxw962530118
Copy link
Author

按照示例代码发现新的问题,就是在文字比较长的的时候,cell整体宽度会比label的实际宽度多出很多,具体可以看下截图(复现的🌹只需要将标题文字改长一点即可)
Snipaste_2024-07-11_11-24-17
Snipaste_2024-07-11_11-24-48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants