When a view is hidden or alpha=0 does it still cost CPU power or is it ignored?
if I go:
[view setAlpha:0];
then
[view setFrame:newFrameRect];
What is the performance implication of that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“Something with an alpha of zero, still is drawn, however a view that is hidden is not redrawn to the screen. Since this only happens when the view changes anyways, the difference should be insignificant…”
EDIT
Therefore, setHidden is useful, while changing the alpha is not as beneficial.
In general, memory-wise, there is little benefit. You need to remove from view in order to maximize performance, but the change is so small, it probably won’t matter.