Skip to content

[BottomNav][iOS]Incorrect color applied to icon/text #7862

Closed

Description

@PeterStaev

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.1
  • Cross-platform modules: 6.1
  • Android Runtime:6.1
  • iOS Runtime:6.1

Describe the bug
Have an image that is white. when placed in the bottom nav it becomes colored blue when the tab is active and grey when the tab is inactive.
For the color of the label it is applied only when the tab is active. When the tab is inactive it becomes the same grey color as the icon.

To Reproduce
https://play.nativescript.org/?template=play-tsc&id=khpHyT

Note the color of the label happens ONLY locally when you run the app. On the playground app it works as expected.

Expected behavior
The icon should either remain the color it is, or there should be options to be colored with a specific color.
The text should get its color from the class/style applied.

Additional context
This is a regression from 6.0.
Related to #6967

Activity

  1. PeterStaev commented on Sep 24, 2019

    @PeterStaev
    ContributorAuthor

    Seems this relates to update to XCode11. I've just rolled back the project to the previous runtime versions and the problem is still present.

  2. bundyo commented on Sep 24, 2019

    @bundyo
    Contributor

    I can't reproduce this in Android? Maybe iOS only?

  3. PeterStaev commented on Sep 24, 2019

    @PeterStaev
    ContributorAuthor

    Title says iOS :)

    After further testing seems the icon coloring is a regression in 6.1. But the text coloring seems iOS13/Xcode11 related.

  4. bundyo commented on Sep 24, 2019

    @bundyo
    Contributor

    It does also say Android runtime: 6.1 below. :) Skipped the title since I knew what I was opening.

  5. tsonevn commented on Sep 25, 2019

    @tsonevn
    Contributor

    Hi @PeterStaev,
    I've rechecked the case and it seems that in your case, you should set iosIconRenderingMode to alwaysOriginal for the TabStrip component. Then the right color will be applied for the images. For your convenience, I am attaching the project with some changes.

  6. PeterStaev commented on Sep 25, 2019

    @PeterStaev
    ContributorAuthor

    Hey @tsonevn , thanks for the provided fix! I can confirm that setting the rendering mode fixes the issue with the icon coloring (so seems there is some default behavior change since 6.0 as it was not needed then).

    But the XCode11/iOS13 problem with the text coloring is still present, even in your provided project. Simply download it locally tns run ios on a machine with XCode11 and you will see the problem.

  7. MartoYankov commented on Oct 9, 2019

    @MartoYankov
    Contributor

    It seems that in iOS13, there is a new API for styling the TabBar (https://developer.apple.com/documentation/uikit/uitabbaritem/3198079-standardappearance?language=objc) and weirdly the old way with setTitleTextAttributesForState doesn't work as expected. We should try the new API for iOS >= 13.

  8. armpogart commented on Oct 23, 2019

    @armpogart

    Any workaround before fixes? How can I set to build the project using old API?

  9. PeterStaev commented on Dec 8, 2019

    @PeterStaev
    ContributorAuthor

    When can we expect a fix for this? I was hoping that all iOS13 issues would be fixed for 6.2, but seems that is not the case 😞

  10. manijak commented on Feb 3, 2020

    @manijak

    When using images as Tab icons with allwaysTemplate render-mode enabled, it would be preferable if the selected-icon-color was the same as selected-label-color. As it is now, my selected tab icons get a weird blue color that I have no control over, and cannot change. This breaks the design in my case.

    The original TabView gets this right and the non-selected/selected image-icons get correct color based on the style settings.

  11. NickIliev commented on Feb 6, 2020

    @NickIliev
    Contributor

    The issue with the color not being applied for a non-active state is reported here - we are currently working on a solution.

  12. rigor789 commented on Sep 7, 2023

    @rigor789
    Member

    Closing because BottomNavigation and Tabs are no longer part of core since NativeScript 8.0:

    https://blog.nativescript.org/nativescript-8-announcement/#important-note-about-bottomnavigation-and-tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions