Skip to content Skip to sidebar Skip to footer

Nativescript Getviewbyid Not Updating For Count Down

So, i am using the timer that i asked about in this question as a count down: How to stop timer.setinterval with a tap event or leaving page in nativescript The counter works, all

Solution 1:

You should you data binding that inherits the Observable class, when a property is changed it will update the XML also. For your case, if you still want to keep your practice you can put the label.text inside the interval to get it updated:

TimeCountScore = page.getViewById("timeCount");

countId = timer.setInterval(() => {
    TimeCountScore.text = time;
}, 1000);  

Post a Comment for "Nativescript Getviewbyid Not Updating For Count Down"