[TIMOB-15502] iOS: Labels in TableView lose their highlight color when navigating away from the window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-11-20T19:24:06.000+0000 |
Affected Version/s | Release 3.1.2, Release 3.1.3 |
Fix Version/s | n/a |
Components | iOS |
Labels | supportTeam, triage |
Reporter | Ashish Nigam |
Assignee | Ingo Muschenetz |
Created | 2013-10-16T11:03:41.000+0000 |
Updated | 2017-03-22T23:02:50.000+0000 |
Description
When we set the hightlightedColor property on labels that are inside table view rows (the table's allowSelection property is true), and navigate away from the window, the hightlightedColor does not show until the row is scrolled out of view and back again.
*Steps to reproduce*
1: Use the below sample code with newly created sample project.
2: Build the sample project for iOS7 simulator.
3: Click on any row and come back to main window.
4: *Label Highlighted color is not shown*.
5: Now scroll the view out of visible portion and take back.
6: Label Highlighted color is shown.
*Sample code*
var tbG = Ti.UI.createTabGroup({
tintColor : "green",
barColor : "yellow"
///backgroundColor:"yellow"
});
var win1 = Ti.UI.createWindow({
backgroundColor : "gray",
tintColor : "red"
});
var win2 = Ti.UI.createWindow({
backgroundColor : "yellow"
});
var tb1 = Ti.UI.createTab({
title : "tab1",
window : win1,
tintColor : "blue"
});
var tb2 = Ti.UI.createTab({
title : "tab2",
window : win2
});
function openanotherWindowNow() {
var win3 = Ti.UI.createWindow({
backgroundColor : "green"
});
tb1.open(win3);
}
// Create a TableView.
var testTable = Ti.UI.createTableView({
allowsSelection : true
});
var lable1 = Ti.UI.createLabel({
text : "value 1",
highlightedColor : "yellow"
});
var lable2 = Ti.UI.createLabel({
text : "value 2",
highlightedColor : "green"
});
var tbRow = Ti.UI.createTableViewRow();
tbRow.add(lable1);
tbRow.add(lable2);
// 2
var lable11 = Ti.UI.createLabel({
top : 5,
text : "value 1",
highlightedColor : "yellow"
});
var lable21 = Ti.UI.createLabel({
top : 25,
text : "value 2",
highlightedColor : "green"
});
var tbRow1 = Ti.UI.createTableViewRow({
selectedBackgroundColor : "blue",
height : 50
});
tbRow1.add(lable11);
tbRow1.add(lable21);
//3
var lable111 = Ti.UI.createLabel({
text : "value 1",
highlightedColor : "yellow"
});
var lable211 = Ti.UI.createLabel({
text : "value 2",
highlightedColor : "green"
});
var tbRow11 = Ti.UI.createTableViewRow({
height : 50,
layout : "vertical",
//selectedColor:"blue",
//selectionStyle:Titanium.UI.iPhone.TableViewCellSelectionStyle.BLUE,
selectedBackgroundColor : "blue",
//backgroundSelectedColor:"blue"
});
tbRow11.add(lable111);
tbRow11.add(lable211);
testTable.setData([tbRow, tbRow1, tbRow11]);
// Listen for click events.
testTable.addEventListener('click', function(e) {
openanotherWindowNow();
});
// Add to the parent view.
win1.add(testTable);
tbG.tabs = [tb1, tb2];
tbG.open();
Attachments
File | Date | Size |
---|---|---|
1-MainScreen.png | 2013-10-21T16:38:07.000+0000 | 30194 |
2-NewWindow.png | 2013-10-21T16:38:07.000+0000 | 18982 |
3-MainScreenAfterBack.png | 2013-10-21T16:38:07.000+0000 | 29979 |
4-MainScreenAfterScroll.png | 2013-10-21T16:38:07.000+0000 | 30351 |
Attaching screenshots
See TIMOB-13499. The behavior is against IOS HIG and my cause app rejection. You should always deselect any selected rows when coming back to the screen. See TableView section in https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf
Closing ticket as "Won't Fix".