Hi guys. I didn't found any documentation on how 'visibility' actually works and for which elements. Only related article I've found is http://tjvantoll.com/2015/06/05/nativescript-showing-and-hiding-elements/ .
Now I'm struggling with following visibility manipulation:
<Page.actionBar>
<ActionBar title="SampleApp">
<ActionBar.actionItems>
<ActionItem text="Stop"
tap="stopTimer" ios.position="right"
visibility="{{ timerId === 0 ? 'collapse' : 'visible' }}"/>
<ActionItem text="Resume"
tap="startTimer" ios.position="right"
visibility="{{ timerId === 0 ? 'visible' : 'collapse' }}"/>
<ActionItem text="Save"
tap="saveEntryToEntriesFile" ios.position="right"
visibility="{{ timerId === 0 ? 'visible' : 'collapse' }}"/>
</ActionBar.actionItems>
</ActionBar>
</Page.actionBar>
timerId, is a set property of pageData observable, which holds page context.
First ActionItem should be seen only when timerId is different from 0 and second+third buttons, when timerId is 0.
But currently all ActionItem elements are always visible, no matter timerId is 0 or holds value different from it.
Would be awesome to have a separate documentation chapter describing how to show/hide elements from both xml markup and code, as well as which elements could be dynamically shown/hidden and which are not.
Hi guys. I didn't found any documentation on how 'visibility' actually works and for which elements. Only related article I've found is http://tjvantoll.com/2015/06/05/nativescript-showing-and-hiding-elements/ .
Now I'm struggling with following visibility manipulation:
timerId, is a set property ofpageDataobservable, which holdspage context.First
ActionItemshould be seen only whentimerIdis different from0and second+third buttons, whentimerIdis0.But currently all
ActionItemelements are always visible, no matter timerId is 0 or holds value different from it.Would be awesome to have a separate documentation chapter describing how to show/hide elements from both xml markup and code, as well as which elements could be dynamically shown/hidden and which are not.