[TIMOB-27460] iOS: tintColor not working for TabbedBar/ButtonBar on iOS 13
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-12-10T15:38:41.000+0000 |
Affected Version/s | Release 8.2.0 |
Fix Version/s | Release 9.0.0 |
Components | iOS |
Labels | engSchedule, regression |
Reporter | nicolomonili |
Assignee | Vijay Singh |
Created | 2019-10-10T09:55:21.000+0000 |
Updated | 2019-12-10T15:38:41.000+0000 |
Description
With iOS 13 the styling of the
UISegmentedControl
significantly changed. Previously the color of the selected element and the border color could simply be set with tintColor
. Now this requires a combination of backgroundColor
/ selectedSegmentTintColor
/ setTitleTextAttributes
and manual settings for borders using the underlying layer
.
See also https://stackoverflow.com/a/56874473/1168989
*Steps to reproduce the behavior*
const win = Ti.UI.createWindow({
backgroundColor: 'black'
});
var test = Ti.UI.createTabbedBar({
labels: [ '1', '2', '3', 'AUTO' ],
tintColor: 'white'
});
win.add(test);
win.open();
*Actual behavior*
The controls has no border and unselected elements are barely visible. !Schermata 2019-10-10 alle 11.21.28.png|thumbnail!
*Expected behavior*
The control has a border and unselected element are colored according to tintColor
. !Schermata 2019-10-10 alle 11.21.24.png|thumbnail!
Attachments
File | Date | Size |
---|---|---|
Schermata 2019-10-10 alle 11.21.24.png | 2019-10-10T10:01:36.000+0000 | 18445 |
Schermata 2019-10-10 alle 11.21.28.png | 2019-10-10T10:01:20.000+0000 | 17635 |
There are updates?
PR - https://github.com/appcelerator/titanium_mobile/pull/11329 1. I think we should not change the default behavior of native UiSegmentControl for iOS 13. In iOS 12 it comes with border but in iOS 13 it do not have border. 2. I have modified the tintColor implementation to set the normal text color (tintColor), selected text color(inverse of tintColor), and selectedButtonColor (tintColor). In most of the cases this will work fine for iOS 13. 3. To add more customization on TabbedBar I have exposed new APIs- textColor, selectedTextColor, selectedButtonColor [~nicolomonili] [~topener] If you guys agree, I'll add documentation for new APIs Test Case 1 (tinColor) -
Test Case 2 (new properties) -
Sounds good to me! We should not mimic things that don't exist anymore, and giving more options is even better!
Ok !
FR Passed, Waiting on Jenkins build.
PR Merged.
This fix could be added in a possible 8.3.x ?
Fix verified in SDK version 9.0.0.v20191204090836 Test and other information an be found at: https://github.com/appcelerator/titanium_mobile/pull/11329
Fix verified on version: 9.0.0.v20191209135132 Ticket closed.