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

iOS 13 darkmode switching #1613

Open
grangej opened this issue Aug 13, 2019 · 7 comments
Open

iOS 13 darkmode switching #1613

grangej opened this issue Aug 13, 2019 · 7 comments

Comments

@grangej
Copy link

grangej commented Aug 13, 2019

Hi ! Can someone please help to explain how to properly switch nodes color on trait switch? What is the high level recommendation from the texture team to get all child nodes to switch colors when the darkmode changes? We understand we need to listen for trait changes but this doesn't seem to be enough to get all the child nodes to switch properly. Any help would be gratefully appreciated.

@rahul-malik
Copy link
Contributor

@grangej - Currently working through this. The best tip I can give you currently is that layerBacked nodes seems to have the most issues. I'm applying changes in asyncTraitCollectionDidChange when necessary but UIViewBridged properties of UIColor just work out of the box.

Make sure you're using the latest commits on master since I've upstreamed a few PRs that do things like setting backgroundColors using UIColor vs CGColor and adding tintColor support for ASImageNode/ASButtonNode/ASTextNode{1,2}

@linlinyao1
Copy link

iOS13 GM is already released

@ruixingchen
Copy link

thanks for your works 👍 @rahul-malik

@rahul-malik
Copy link
Contributor

@ruixingchen - thanks for the comment. everything should be shippable at this point.

A few things that I didn't mention before:

@choiapril6
Copy link

Hi @rahul-malik,
as you mentioned above I've tried with the version of master.
However, the image node doesn't seem to change right after the dark mode toggled. (If the app reload the view, then the dark mode image appears.) Any clue that I am missing?

@ruixingchen
Copy link

@choiapril6 for current time I use reloadData() on my list view and re-set any dark color or image manually in other nodes, the auto-refresh is not reliable enough for me, even the master branch has many problems like the tableNode insert animation issue
at last, just do things by yourself now

@amyaots
Copy link

amyaots commented Jan 22, 2021

@rahul-malik Hello! In the last version Texture asyncTraitCollectionDidChange does not call when I change dark mode :(

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

6 participants