-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
TabView button icons (iOS) #1278
Description
I am creating a separate issue based my comments here: #1269
The original question was answered.
@vakrilov , @maknz
From what I can see in tab-view.ios.js under tns_core_modules, line 218 is reason why tab-view icons look different in the latest release.
...
var originalRenderedImage = is.ios.imageWithRenderingMode(UIImageRenderingMode.UIImageRenderingModeAlwaysOriginal);
...The icon image rendering mode is set to AlwaysOriginal. This means the icons will keep their original rendering, this is not default iOS behaviour, I think...
If I override this to AlwaysTemplate or Automatic, it will use the iOS color-templating on the tabBar icons. And you can define both text and icon color with the selectedColor property.
Most of the time it is easier to use AlwaysTemplate since iOS takes care of the normal and selected color for each button, and you can use one icon for both states.
But if we use AlwaysOriginal then we must provide both normal and selected icon-images, since they are not colored by iOS anymore. So we need to provide to version of each icon (one for each state). And from the looks of it, TabView in nativescript does not provide properites to add icons for both states.