Closed noetius closed 7 years ago
Hi @noetius,
I tested your scenario on my side and indeed this is an issue within NativeScirpt 3,0.
When you try to change runtime iconSource of the Tab
the following exception will be throw.
TypeError: tabLayout.updateItemAt is not a function
The problem could be reproduced only for Android
. I am attaching sample project, which could be used for debugging. For further info. you could keep track on the issue.
Archive.zip
No updates?
Can't change title either. Got same error message.
Hi @szbpmf, Indeed the text can't be also changed from the code behind. This issue is still under review and the fix could be expected for some of the next NativeScript versions, unfortunately, I can not commit to an exact timeframe when this will be ready.
I would to point out, that this problem is reproducible on iOS too.
When it will be released 3.1 version?
On iOS I can not take advantage of the icon font approach, because I can't vertically center icons.
Considering the passed time from the case opening, it would be helpful to have at least an approximate time frame for the fix's release. It is becoming increasingly difficult to find workarounds.
Same error, thank you Nativescript! :'( Now we have to wait with no solution!
@noetius, @nicosaliagas this issue is backlogged and scheduled for fixing with NativeScript 3.1. The release is expected roughly at the end of the month.
As NativeScript is open-source, every community member can become a contributor and help the product evolve.
Aren't there any workarounds? It's nice to see that the issue has been acknowledged; however, I need to find a fix as soon as possible.
@NickIliev Thanks fot the reply, at the moment I've managed to use icon fonts approach on android, and icons without text on ios, in order to keep the UI consistency between platforms.
For eveyone else, if text labels are not mandatory for yours TabView, I'd suggest this approach as temporary workaround.
+1 from SB
I've updated Nativescript (https://www.nativescript.org/blog/nativescript-3.1-just-released) but i still have the same error : tabLayout.updateItemAt is not a function
Unfortunately, it seems that this case will be fixed in NativeScript 3.2. I'm very afraid to upgrade for the moment, there are always bad surprises behind the corner...
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please, provide the details below:
Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?
Yes
Tell us about the problem
In a TabView, when the user taps on a TabViewItem in order to see its content, I need to replace the unselected version of the TabViewItem icon with an highlighted version. Before NativeScript 3.0.0, it was possible to bind a callback to TabView's selectedIndexChanged event, accessing TabViewItems by appropriate indexes, and replacing their iconSource without hassle. But now happens this exception:
Logcat:
For every TabViewItem, I need to preserve the title, so I can't rely on the icon font approach.
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
home.js
home.xml