Skip to content

Update iOS TabView to use Automatic rendering mode#2435

Merged
hamorphis merged 1 commit intoNativeScript:masterfrom
toddanglin:patch-1
Jul 13, 2016
Merged

Update iOS TabView to use Automatic rendering mode#2435
hamorphis merged 1 commit intoNativeScript:masterfrom
toddanglin:patch-1

Conversation

@toddanglin
Copy link
Copy Markdown

Fixes/Implements #1278

Very small change. Does not impact the TabView unit tests.

Changes the UIImageRenderingMode for tab icons from "AlwaysOriginal" to "Automatic." This allows icon images to inherit the selectedColor specified for the tabview (eliminating the need to provide two versions of every tab icon).

Unclear why this behavior was changed in NativeScript 1.5 (history of tab-view.ios.ts only goes back to May). This change restores behavior of tabview icons to pre-1.5 styling and is a huge time saver for iOS tabview styling.

Change the UIImageRenderingMode for tab icons from "AlwaysOriginal" to "Automatic." This will allow icon images to inherit the `selectedColor` specified for the tabview (eliminating the need to provide two versions of every tab icon).
@ns-bot
Copy link
Copy Markdown

ns-bot commented Jul 9, 2016

Can one of the admins verify this patch?

@toddanglin
Copy link
Copy Markdown
Author

@tjvantoll @jlooper Do either you have any additional context on why this UIImageRenderingMode was changed in the past? If there is no good reason to keep the change, the Automatic mode seems way more helpful as the default.

@ns-bot
Copy link
Copy Markdown

ns-bot commented Jul 9, 2016

Please sign CLA at http://www.nativescript.org/cla

@ns-bot ns-bot added the cla: no label Jul 9, 2016
@ns-bot
Copy link
Copy Markdown

ns-bot commented Jul 9, 2016

CLA signature found, happy contributing!

@ns-bot ns-bot added cla: yes and removed cla: no labels Jul 9, 2016
@tjvantoll
Copy link
Copy Markdown
Contributor

tjvantoll commented Jul 11, 2016

@toddanglin Unless I’m missing something, I don’t think UIImageRenderingMode actually changed in 1.5. Here’s the commit in question that landed in 1.5.1; here’s the PR. It looks like the change was using imageWithRenderingMode() instead of setting the renderingMode property directly.

I see UIImageRenderingModeAlwaysOriginal being used all the way back to the original commit that introduced the ability to add images to tabs back in March of 2015.

Not sure whether changing UIImageRenderingMode would have any repercussions, but I personally can’t think of any, and I like the idea of making selectedColor easier to use 😄

@toddanglin
Copy link
Copy Markdown
Author

@tjvantoll Thanks for finding the old commit!

I recall in earlier versions of {N} the tab icon colors did change on iOS, so I wonder if something changed in iOS? Either way, this pull request would simply change the rendering mode to UIImageRenderingModeAutomatic, which seems to be a superior option for styling tab icons.

Apps that have already added multiple icons to deal with AlwaysOriginal rendering should only have to ensure selectedColor is properly set in their TabView to avoid any visual change.

If this change is too heavy handed, the next best thing (I suppose) would be a new property on the TabView allowing developers to specify "rendering mode"...but long-term I can't see why anyone would want to import more images just to deal with selected state coloring.

@hamorphis hamorphis merged commit c3ce128 into NativeScript:master Jul 13, 2016
@hamorphis
Copy link
Copy Markdown
Contributor

@toddanglin I merged the pull request. Thank you for this fix.

@hamorphis hamorphis added this to the 2.2 (Under review) milestone Jul 13, 2016
@lock
Copy link
Copy Markdown

lock bot commented Aug 28, 2019

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.

@lock lock bot locked and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants