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

selectedContent text color is reset to black #116

Open
70m3n opened this issue Sep 7, 2021 · 3 comments
Open

selectedContent text color is reset to black #116

70m3n opened this issue Sep 7, 2021 · 3 comments

Comments

@70m3n
Copy link

70m3n commented Sep 7, 2021

I set different background colors and text colors for normal content/style and selected content/style. Background colors always display correct, but the text color is reset when scrolling a tableView with a TTGTextTagCollectionView for each cell. So when the cell re-renders in cellForRowAt, the text color is almost always black. I set it to be white on selected tags.

@zekunyan
Copy link
Owner

zekunyan commented Sep 8, 2021

@70m3n Can you provide some Demo code ? Thank you.

@70m3n
Copy link
Author

70m3n commented Sep 9, 2021

It's hard to provide any demo code, because the app I'm working on has some fairly complex UI. That may also be the source of my problem. I did however make a sample app, with only one view controller with a table view, listing tags in several sections, thus rendering n number of TTGTextTagCollectionViews. That worked fine.

After som debugging in the app I'm working on I found that the text color in TTGTextTagStringContent wasn't reset back to the normal color I set (dark gray). It was reset back to black, which I'm not sure where comes from.

I'm not sure what causes the problem, if it is my code or the code in the package, or even a combination. Life cycle events. Race conditions. I'm out of options.

Thanks for your time, though.

I attached an image showing the problem in action.

Simulator Screen Shot - iPhone 12 mini - 2021-09-09 at 13 55 12

@Ahmed-Masoud
Copy link

I had the same issue I didn't notice that you can set content and selectedContent separately for a tag leaving this here for anyone in the future
let tag = TTGTextTag.init() tag.content = content tag.selectedContent = selectedContent

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