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

设置isTitleMaskEnabled和isTitleColorGradientEnabled会有问题 #264

Open
hubin97 opened this issue Oct 9, 2024 · 7 comments
Open

设置isTitleMaskEnabled和isTitleColorGradientEnabled会有问题 #264

hubin97 opened this issue Oct 9, 2024 · 7 comments

Comments

@hubin97
Copy link

hubin97 commented Oct 9, 2024

    //!!!: 设置颜色渐变,和遮罩会影响文案的字体颜色及显示
    //_segmentedDataSource.isTitleColorGradientEnabled = true  // 禁用颜色渐变,排查干扰
    //_segmentedDataSource.isTitleMaskEnabled = true

设置后有两个现象

  1. 首次加载选中文字变成白色, 看起来就是不显示, 可以reload 显示
  2. 选中时, 文字的颜色不是设置的选中颜色; 需要点击两次
@RocPengPeng
Copy link

isTitleColorGradientEnabled
设置true时,长按拖动选中的item,该item字体颜色会变成未选中的字体颜色,demo可以复现

@duyg
Copy link

duyg commented Oct 22, 2024

isTitleColorGradientEnabled 设置true时,长按拖动选中的item,该item字体颜色会变成未选中的字体颜色,demo可以复现

我也是这个问题。但是isTitleColorGradientEnabled设置成false依然不行。按住tab的文字左右滑动,文字颜色就会变成默认颜色,而不是选中的。reload也不能解决

@RocPengPeng
Copy link

isTitleColorGradientEnabled 设置true时,长按拖动选中的item,该item字体颜色会变成未选中的字体颜色,demo可以复现

我也是这个问题。但是isTitleColorGradientEnabled设置成false依然不行。按住tab的文字左右滑动,文字颜色就会变成默认颜色,而不是选中的。reload也不能解决

使用JXSegmentedTitleGradientDataSource不会有这个问题

@duyg
Copy link

duyg commented Oct 22, 2024

isTitleColorGradientEnabled 设置true时,长按拖动选中的item,该item字体颜色会变成未选中的字体颜色,demo可以复现

我也是这个问题。但是isTitleColorGradientEnabled设置成false依然不行。按住tab的文字左右滑动,文字颜色就会变成默认颜色,而不是选中的。reload也不能解决

使用JXSegmentedTitleGradientDataSource不会有这个问题

感谢。换了1.2.1版本问题解决~

@hubin97
Copy link
Author

hubin97 commented Oct 22, 2024

不是注释掉 不用设置那两行就好了么, 除非真的业务有需求

@duyg
Copy link

duyg commented Oct 22, 2024

segmentedViewDataSource = JXSegmentedTitleDataSource()
segmentedViewDataSource.titles = tabs.flatMap({ $0.title })
segmentedViewDataSource.titleSelectedColor = UIColor.red6
segmentedViewDataSource.titleNormalColor = UIColor.blackblue5
segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: CGFloat(50.0)))
segmentedView.backgroundColor = UIColor.white
segmentedView.dataSource = segmentedViewDataSource
segmentedView.delegate = self
let lineView = JXSegmentedIndicatorLineView()
lineView.indicatorColor = UIColor.red6
lineView.indicatorWidth = 24.0.adaptLength
lineView.indicatorHeight = 2.0.adaptLength
segmentedView.indicators = [lineView]
addSubview(segmentedView)

@duyg
Copy link

duyg commented Oct 22, 2024

不是注释掉 不用设置那两行就好了么, 除非真的业务有需求

我没设置那两行。。。。

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

3 participants