Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Bind to hidden and alpha/alphaValue simultaneously #29

Open
jspahrsummers opened this issue Dec 23, 2012 · 2 comments
Open

Bind to hidden and alpha/alphaValue simultaneously #29

jspahrsummers opened this issue Dec 23, 2012 · 2 comments

Comments

@jspahrsummers
Copy link
Member

A binding to rcl_alpha or rcl_alphaValue could automatically flip hidden based on the alpha value.

On iOS, this would mostly just make the hidden property more useful, since there should be no performance difference between alpha = 0 and hidden = YES.

On OS X, however, this would be useful in conjunction with #28. Basically, you could animate the alpha even for a view that's not layer-backed (while resting). rcl_alphaValue could simply translate into hidden, but then a binding could enable layer-backing, animate the alpha, and disable layer-backing once finished.

@zakdances
Copy link
Contributor

According to an SO comment

by setting view.alpha = 0.0f, iOS also sets view.hidden = yes internally, in fact, there is a
threshold for alpha (0.1f), for alpha values smaller than this threshold, view.hidden gets set to YES.

@jspahrsummers
Copy link
Member Author

@zakdances As I pointed out above, we wouldn't do this as an optimization (because it wouldn't be one). It would be strictly to make view.hidden more meaningful, as well as to support layer-backing magic on OS X.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants