JXCategoryView icon indicating copy to clipboard operation
JXCategoryView copied to clipboard

设置contentEdgeInsetLeft后reloadData, 定位偏移

Open huangxianyu opened this issue 1 year ago • 0 comments

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

huangxianyu avatar Aug 28 '23 02:08 huangxianyu