SDK:5.0.2
Device: Fitbit Versa3(36.128.5.38)
What does it do internally when I write code like below?
When foo is true, Will the rendering invoke twice? Or, combine into once?
Is it be better to write like below?
Answered! Go to the Best Answer.
Best AnswerI think the latter could be more efficient, because changing an element's x might result in the layout being recalculated each time. (Maybe it doesn't, if layouts are only recalculated after all of your code has finished.)
Although it's probably not what you want to do, you could write aGraphicsElement.x = foo? 20 : 10;
I think the latter could be more efficient, because changing an element's x might result in the layout being recalculated each time. (Maybe it doesn't, if layouts are only recalculated after all of your code has finished.)
Although it's probably not what you want to do, you could write aGraphicsElement.x = foo? 20 : 10;