Add function to set icons programatically
russellbanks opened this issue · 2 comments
russellbanks commented
It would be great to have the feature to set icons for the bottom bar programmatically as it would mean that any third party libraries such as Android Iconics can be utilised so that drawable resources do not have to be used in XML and can be created programmatically instead.
bottomBar.tabs[i].icon = customIcon
currently says Val cannot be reassigned
.
Droppers commented
You can already pass a drawable to the createTab() function, do you mean changing the tab icon after it has been created?
It cannot be reassigned since the BottomBar won't know that the icon property has been changed, therefore will still show the old icon.
russellbanks commented
Thank you for your reply. Although this didn't work for me, it was what I was looking for :)