[TIMOB-27263] iOS 13: Modal windows with large titles do not honor barColor
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-09-17T16:04:25.000+0000 |
Affected Version/s | Release 8.2.0 |
Fix Version/s | Release 8.2.0 |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Vijay Singh |
Created | 2019-07-20T22:07:59.000+0000 |
Updated | 2020-11-23T04:36:46.000+0000 |
Description
On iOS 13, modal windows with large titles do not honor their
barColor
property. Natively, it seems like iOS 13 receives it's modal bar color from the background (see native app attached), but doing the same in Titanium also doesn't work. Here is what I tried (both with backgroundColor and barColor):
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'Open VC'
});
btn.addEventListener('click', function() {
var win2 = Ti.UI.createWindow({ backgroundColor: 'red', title: 'Hello', largeTitleEnabled: true });
var nav = Ti.UI.createNavigationWindow({
window: win2
});
nav.open({ modal: true })
});
win.add(btn);
win.open();
In addition, it seems like Titanium applies the default bar tint color different to native iOS, which should be investigated in a different ticket!
Attachments
File | Date | Size |
---|---|---|
Bildschirmfoto 2019-08-14 um 12.43.50.png | 2019-08-14T10:43:57.000+0000 | 108520 |
native_modal_normal.png | 2019-08-14T12:37:45.000+0000 | 55599 |
test_barcolor_adapted.zip | 2019-08-16T20:18:10.000+0000 | 47620 |
test_barcolor.zip | 2019-08-14T12:37:17.000+0000 | 36072 |
ti_modal_large.png | 2019-08-14T12:37:45.000+0000 | 30899 |
tie_modal_normal.png | 2019-08-14T12:37:45.000+0000 | 60858 |
[~vijaysingh] Any update here? This is one of the last iOS 13 blockers we have. You can fix it by using the
UINavigationBarAppearance
class for iOS 13+I updated the native test case with "test_barcolor_adapted" which fixes it properly by using
UINavigationBar.appearance().backgroundColor = XXXX
on iOS 13+ and resets it tonil
on theviewWillDisappear
delegate of the view controller so it's more flexible for other windows. But I think it should be synced inViewWillAppear
as well, so other view controller can tint back to their color as well. We workarounded it by blocking large titles if dark mode is enabled.[~hknoechel] 1. In navigation bar 'barTintColor' property is not working when 'prefersLargeTitles' is set true. This is happening in native code as well. So I will file a bug to apple. I am looking for workaround and trying suggestion given by you as well. 2. For backgroundColor, Ideally backgroundColor of window should come behind the navigation bar as per native behavior in iOS 13. I am looking in this.
[~vijaysingh] That is not correct. When
prefersLargeTitles
is set totrue
, the background-color is used for tinting the nav bar - per design. The same does not work for Titanium, so Titanium needs to fix it. This is a release blocker, so we hope this can be investigated soon. *EDIT*: This also effects light mode with large titles + **non**-modal windows. Please take this bug serious.PR - https://github.com/appcelerator/titanium_mobile/pull/11184 Test Case 1-
Test Case 2 -
Test Case 3 -
[~hknoechel] Would you like to test above PR. I am still working on this to find a better solution.
Reason of this issue is that we set the default value of property [edgesForExtendedLayout ](https://github.com/appcelerator/titanium_mobile/blob/da842f4eff133891667abac41b197a177ff94944/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m#L1577) to UIRectEdgeNone from [here](https://github.com/appcelerator/titanium_mobile/blob/da842f4eff133891667abac41b197a177ff94944/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m#L1641). Apple recommend to not change default value as per [doc](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621515-edgesforextendedlayout?language=objc). So use window property [extendEdges](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup-property-extendEdges).
Note- With Above PR there is minor flickering issue. But it is better to have that PR in SDK. We should not change default value extendEdges in minor release.
Interesting! So does moving to EXTEND_EDGE_TOP + using the PR fix all flicker issues? And please consider making it to EXTEND_EDGE_ALL in SDK 9.0 (maybe with a ticket to remind everyone). If I remember correctly, there used to be some issues (around SDK 4/5) related to list-views in windows with extended edges, but maybe thats fixed by now.
We just tested with "extendEdges" on all windows + your latest pull request changes and it does not fix the issue so far.
[~hknoechel] you are still seeing flickering issue or any other?
Still the same as yesterday. You can test with our app.
[~hknoechel] Its weird if I use property in view's .xml file it doesn't work. I guess you are using this property inside .xml . Please use it inside Controller'e .js file. See attached [sample app](https://www.dropbox.com/s/e1x3dfiqdfmmdaz/TestAise.zip?dl=0). I do not have access to your app.
FR Passed. PR Merged.
Keeping this ticket in resolved as more fixes and additions can be made to it.
[~lchoudhary] PR (with minor fixes) - https://github.com/appcelerator/titanium_mobile/pull/11199 PR (8_2_X) - https://github.com/appcelerator/titanium_mobile/pull/11209
Again, this is not fixed so far. Recent changes caused a regression that now tints the bar-color of windows with large titles to be different from the background-color of the view, which is what all this should be about. We tested the above (currently unmerged) pull request as well. Note that is does work with modal windows with large titles now, but not inside tab groups (and probably for normal navigation windows).
Workaround: Remove the
barColor
for iOS 13 and later![~hknoechel] Please see my latest comment in PR https://github.com/appcelerator/titanium_mobile/pull/11184. barColor has preference over backgroundColor. It will give more customization on navigation bar.
Verified the fix in SDK 8.2.0.v20190916135701. Closing.