Closed dlcole closed 2 years ago
After further investigation I found I could make this work be popping both the TabContentItems array and the TabStripItems array, specifically,
let btmnav = page.getViewById("btmnav");
if (isAndroid && btmnav.tabStrip.items.length == 3 && !viewModel.isDirector) {
btmnav.items.pop(); // remove TabContentItems
btmnav.tabStrip.items.pop(); // Remove TabStripItems
}
I'll close this issue and hope this helps others looking to do the same thing.
I have a scenario where I have three Bottom Navigation tabs and need to remove the third tab if the user is not authorized to access. This works fine on iOS; I can simply pop the items array and everything works as desired. On Android, however, the tab remains visible but becomes disabled (at least, it's not tappable).
I've spent two days trying everything I can think of:
My question: is it possible to optionally add or remove a tab on Android? Mine is a JavaScript project, so ngIf isn't an option here. I've created a related SO post, but with few views and no responses. I have reviewed every issue in this repository.
Environment:
Dependencies