Skip to content
New issue

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

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

Already on GitHub? # to your account

设置contentEdgeInsetLeft后reloadData, 定位偏移 #485

Open
huangxianyu opened this issue Aug 28, 2023 · 0 comments
Open

设置contentEdgeInsetLeft后reloadData, 定位偏移 #485

huangxianyu opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@huangxianyu
Copy link

bug描述
辛苦大佬, 帮看一下是什么问题.
设置contentEdgeInsetLeft后reloadData, CategoryView定位偏移, contentOffset计算不准确, 如果contentEdgeInsetLeft = JXCategoryViewAutomaticDimension再reloadData就没问题.

版本号
1.6.1

复现步骤
在TitleViewController中修改代码如下

  • (void)viewDidLoad {
    [super viewDidLoad];
    self.myCategoryView.contentEdgeInsetLeft = 40;
    self.myCategoryView.contentEdgeInsetRight = 40;

    self.myCategoryView.titles = self.titles;

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [self.myCategoryView reloadData];
    });
    }
    在reloadData前, 点击定位一个item是居中的, reloadData后就向右偏移了

截图、GIF
reload前后对比@2x

@pujiaxin33 pujiaxin33 added the bug Something isn't working label Jul 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants