Skip to content

TabView button icons (iOS) #1278

Closed
Closed

Description

@manijak

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.

Activity

  1. added this to the milestone on Dec 21, 2015
  2. stevetayloruk commented on Jan 9, 2016

    @stevetayloruk

    +1

  3. modified the milestones: , 1.6.0 on Feb 15, 2016
  4. removed this from the milestone on Feb 22, 2016
  5. manijak commented on Mar 16, 2016

    @manijak
    Author

    This should have been fixed/improved for 1.7.0. Very annoying issue where we have to manually change tab-view.ios.js every time there is a release/update to the core-modules.

    Please change the image render mode to Automatic and give us the ability to set color to both selected and non-selected buttons. And/Or the possibility to set normal and selected icons.

  6. added this to the milestone on Jul 13, 2016
  7. hamorphis commented on Jul 13, 2016

    @hamorphis
    Contributor

    @manijak It's fixed. For simple stuff like this you can always change one two lines of code and then open a pull request.

  8. toddanglin commented on Jul 13, 2016

    @toddanglin

    @manijak Thanks again for raising this issue and providing the suggested solution! Everyone will now benefit in the 2.2 release.

  9. self-assigned this
    on Jul 20, 2016
  10. leocaseiro commented on Aug 12, 2016

    @leocaseiro
    Contributor

    Perhaps, would be nice if we had the option to choose between UIImageRenderingModeAlwaysOriginal and UIImageRenderingModeAutomatic.

  11. lock commented on Aug 29, 2019

    @lock

    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.

  12. locked and limited conversation to collaborators on Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions