Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS][Dark Mode] Change method for setting view default tint color
The issue with using UIView.appearance.tintColor is that becomes the new default, breaking tintColor's inheritance mechanism. In general, if tintColor is unset, UIKit walks up the view hierarchy until it finds the nearest set tintColor, and uses that. Now, because tintColor is set everywhere through UIAppearance, that never happens. In the linked bug, the close button had a tint set on the UIButton, but not the contained UIImageView. This new method sets the tintColor on the root window, so inheritance still works. If a superview has a provided tintColor, it will apply to any subviews. For a given view, if it and no ancestors have a tintColor, the root window will be the closest ancestor and thus the default. Bug: 1001501 Change-Id: I06b354e56fd43ec8e171be5b4af4b2e3c7c8bbed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789384 Reviewed-by: Mark Cogan <[email protected]> Commit-Queue: Robbie Gibson <[email protected]> Cr-Commit-Position: refs/heads/master@{#694254}
- Loading branch information