[TIMOB-19960] Windows: background color/image for Ti.UI.Tab and TabGroup
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-05-03T14:51:41.000+0000 |
| Affected Version/s | Release 5.1.0 |
| Fix Version/s | Release 5.3.0 |
| Components | Windows |
| Labels | qe-5.3.0 |
| Reporter | Kota Iguchi |
| Assignee | Kota Iguchi |
| Created | 2015-11-13T08:22:43.000+0000 |
| Updated | 2016-05-04T17:33:04.000+0000 |
Description
Ti.UI.TabGroup and Ti.UI.Tab for Windows should be able to support background color/image such as backgroundColor and barColor.
https://github.com/appcelerator/titanium_mobile_windows/pull/498
For testing active tab selected color:
Some properties doesn't work because of platform component (var tabGroup = Titanium.UI.createTabGroup(); tabGroup.activeTabBackgroundColor = 'red'; tabGroup.activeTabBackgroundSelectedColor = 'cyan'; var win1 = Titanium.UI.createWindow({ title: 'Tab 1', backgroundColor: '#fff' }); var tab1 = Titanium.UI.createTab({ icon: 'KS_nav_views.png', title: 'Tab 1', window: win1 }); var label1 = Titanium.UI.createLabel({ color: '#999', text: 'I am Window 1', font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center', width: 'auto' }); win1.add(label1); var win2 = Titanium.UI.createWindow({ title: 'Tab 2', backgroundColor: '#fff' }); var tab2 = Titanium.UI.createTab({ title: 'Tab 2', window: win2 }); var label2 = Titanium.UI.createLabel({ color: '#999', text: 'I am Window 2', font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center', width: 'auto' }); win2.add(label2); tabGroup.addTab(tab1); tabGroup.addTab(tab2); tabGroup.open();Xaml::Control::PivotItem) limitation: -backgroundDisabledColortakes no effect forTabbecause native component doesn't change its color if it's disabled -backgroundFocusedColortakes no effect forTabbecause native component doesn't get focus event[~kota] I am able to test these properties but the [docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup-property-tabsBackgroundDisabledColor) state that they are all supported properties. ||Properties||Working|| |TabGroup.barColor| (/)| |TabGroup.tabsBackgroundColor| (/)| |TabGroup.tabsBackgroundImage| (/)| |TabGroup.tabsBackgroundDisabledColor|(x)| |TabGroup.tabsBackgroundDisabledImage|(x)| |TabGroup.tabsBackgroundFocusedColor|(x)| |TabGroup.tabsBackgroundFocusedImage|(x)| |TabGroup.tabsBackgroundSelectedColor|(x)| |TabGroup.tabsBackgroundSelectedImage|(x)| |TabGroup.activeTabBackgroundColor| (/)| |TabGroup.activeTabBackgroundImage| (/)| |TabGroup.activeTabBackgroundDisabledColor|(x)| |TabGroup.activeTabBackgroundDisabledImage|(x)| |TabGroup.activeTabBackgroundFocusedColor|(x)| |TabGroup.activeTabBackgroundFocusedImage|(x)| |TabGroup.activeTabBackgroundSelectedColor|(x)| |TabGroup.activeTabBackgroundSelectedImage|(x)| |Tab.backgroundDisabledColor|(x)| |Tab.backgroundDisabledImage|(x)| |Tab.backgroundFocusedColor|(x)| |Tab.backgroundFocusedImage|(x)| |Tab.backgroundImage| (/)| |Tab.backgroundSelectedImage|(x)| |Tab.backgroundColor| (/)|
[~kota], I am fairly confused about the intent of this ticket. This ticket seems like it's a fix for Windows Tab/TabGroup background color/image, which Josh has shown above. However, as indicated by Josh's table, the PR contains implementation for disabled, focused, and selected color/image properties, but they do not work and contradicts what we have documented here: [doc](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup-property-tabsBackgroundDisabledColor) Will reopen this ticket.
Yeah, so some properties doesn't work because of platform limitations. Documentation needs to be updated, will push soon.
[~jlongton] I think BackgroundSelectedColor/Image should work. Note that "selected color" works when you select Tab Window (tab content). What's confusing here I think is that background color is exclusive state, for example when
tabsBackgroundSelectedColorandactiveTabBackgroundSelectedColorare set,tabsBackgroundSelectedColortakes no effect on active tab because there'sactiveTabBackgroundSelectedColor.As far as I seevar tabGroup = Titanium.UI.createTabGroup(); var win1 = Titanium.UI.createWindow({ title: 'Tab 1', backgroundColor: '#fff' }); var tab1 = Titanium.UI.createTab({ icon: 'KS_nav_views.png', title: 'Tab 1', window: win1 }); var label1 = Titanium.UI.createLabel({ color: '#999', text: 'I am Window 1', font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center', width: 'auto' }); win1.add(label1); var win2 = Titanium.UI.createWindow({ title: 'Tab 2', backgroundColor: '#fff' }); var tab2 = Titanium.UI.createTab({ title: 'Tab 2', window: win2 }); var label2 = Titanium.UI.createLabel({ color: '#999', text: 'I am Window 2', font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center', width: 'auto' }); win2.add(label2); tabGroup.addTab(tab1); tabGroup.addTab(tab2); //tabGroup.tabsBackgroundSelectedColor = 'blue'; tabGroup.activeTabBackgroundColor = 'red'; tabGroup.activeTabBackgroundSelectedColor = 'cyan'; tabGroup.open();selectedproperty does work, so final table goes like this: ||Properties||Working|| |TabGroup.barColor| (/)| |TabGroup.tabsBackgroundColor| (/)| |TabGroup.tabsBackgroundImage| (/)| |TabGroup.tabsBackgroundDisabledColor|(x)| |TabGroup.tabsBackgroundDisabledImage|(x)| |TabGroup.tabsBackgroundFocusedColor|(x)| |TabGroup.tabsBackgroundFocusedImage|(x)| |TabGroup.tabsBackgroundSelectedColor|(/)| |TabGroup.tabsBackgroundSelectedImage|(/)| |TabGroup.activeTabBackgroundColor| (/)| |TabGroup.activeTabBackgroundImage| (/)| |TabGroup.activeTabBackgroundDisabledColor|(x)| |TabGroup.activeTabBackgroundDisabledImage|(x)| |TabGroup.activeTabBackgroundFocusedColor|(x)| |TabGroup.activeTabBackgroundFocusedImage|(x)| |TabGroup.activeTabBackgroundSelectedColor|(/)| |TabGroup.activeTabBackgroundSelectedImage|(/)| |Tab.backgroundDisabledColor|(x)| |Tab.backgroundDisabledImage|(x)| |Tab.backgroundFocusedColor|(x)| |Tab.backgroundFocusedImage|(x)| |Tab.backgroundImage| (/)| |Tab.backgroundSelectedColor|(/)| |Tab.backgroundSelectedImage|(/)| |Tab.backgroundColor| (/)|https://github.com/appcelerator/titanium_mobile_windows/pull/661 https://github.com/appcelerator/titanium_mobile_windows/pull/662
Merged the doc-only PRs. They removed the *Disabled* and *Focused* Tab properties from our supported list.
Verified as fixed Tested on: Nokia Lumia 928 (8.1) Windows Simulator (8.1) Microsoft Lumia 640 (10) Windows Simulator (10) Windows 10 Studio: 4.6.0.201604290815 Ti SDK: 5.3.0.v20160502145620 Appc NPM: 4.2.5-5 App CLI: 5.3.0-42 Node v4.4.3 *Closing Ticket.*