Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15502] iOS: Labels in TableView lose their highlight color when navigating away from the window

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2013-11-20T19:24:06.000+0000
Affected Version/sRelease 3.1.2, Release 3.1.3
Fix Version/sn/a
ComponentsiOS
LabelssupportTeam, triage
ReporterAshish Nigam
AssigneeIngo Muschenetz
Created2013-10-16T11:03:41.000+0000
Updated2017-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

FileDateSize
1-MainScreen.png2013-10-21T16:38:07.000+000030194
2-NewWindow.png2013-10-21T16:38:07.000+000018982
3-MainScreenAfterBack.png2013-10-21T16:38:07.000+000029979
4-MainScreenAfterScroll.png2013-10-21T16:38:07.000+000030351

Comments

  1. Davide Cassenti 2013-10-21

    Attaching screenshots
  2. Vishal Duggal 2013-11-20

    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
  3. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".

JSON Source