This question is locked. New answers and comments are not allowed.
Hello,
I try to define some databinding in JavaScript Code, like I usually did in XML before:
<
ActivityIndicator
busy
=
"{{ isLoading }}"
visibility={{ isLoading ? 'visible' : 'collapse' }} />
Now it is necessary for me to define this in JavaScript, as I need to create the UI dynamically in JavaScript.
I tried to define the busy binding and visibility binding like this:
activityIndicator.bind({
//works
sourceProperty:
"isLoading"
,
targetProperty:
"busy"
,
twoWay:
true
}, myObservable);
activityIndicator.bind({
//does NOT work
sourceProperty:
"isLoading"
?
'visible'
:
'collapse'
,
targetProperty:
"visibility"
,
twoWay:
true
}, myObservable);
The busy binding works as expected, but not the visibility-binding. When the ActivityIndicator is not busy, it should not consume any space, but as you can see in the gif (please have a look at the attachment), there is some 'white space' even when the Indicator is not busy.
I tried this with NativeScript 2.3 and 2.4. So it seems that I am generally making a mistake.
Can you tell me what I am doing wrong?
Best regards