Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11300] iOS: Grouped tableview background color not behaving as expected

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-10T19:59:36.000+0000
Affected Version/sRelease 2.1.3, Release 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21
ComponentsiOS
Labelsapi, qe-ios100112
ReporterEric Merriman
AssigneeVishal Duggal
Created2012-10-08T21:33:47.000+0000
Updated2012-12-04T19:34:15.000+0000

Description

When using a grouped tableview with "style: Titanium.UI.iPhone.TableViewStyle.GROUPED", the background color of the tableview is not behaving as expected. When using the default settings (with no color set) it is expected that all iOS versions show the "striped" background. This is not the case with iOS 6, it seems a transparent background is used. Additionally, when setting a background color, the tableview rows also adopt this color, this occurs on all iOS versions tested (iOS 4.3.5, 5.1, 6.0). This is a regression as it does not occur in 2.1.2GA (unable to test on device)
var win = Ti.UI.createWindow();

var data = [
		{title:'Row 1', hasChild:true, color:'red', selectedColor:'#fff'},
		{title:'Row 2', hasDetail:true, color:'green', selectedColor:'#fff'},
		{title:'Row 3', hasCheck:true, color:'blue', selectedColor:'#fff'},
		{title:'Row 4', color:'orange', selectedColor:'#fff'}
	];
	
var tableview = Titanium.UI.createTableView({
		data:data,
		style: Titanium.UI.iPhone.TableViewStyle.GROUPED//,
		//backgroundColor: "red"
	});
	
win.add(tableview);
win.open();
Steps to reproduce: part one: 1) Create a project with the sample code above 2) Run in iOS 6 simulator or on device part two: 1) Uncomment background color and comma in code 2) Run in simulator or on device Results: part one: iOS 6: Transparent background iOS <6: Striped background Part two: Tableview and tableview rows show red color

Attachments

FileDateSize
2.1.2 on iOS 6.png2012-10-08T21:47:05.000+000062020
2.1.3 on iOS 5.png2012-10-08T21:47:05.000+000046330
2.1.3 on iOS 6.png2012-10-08T21:47:05.000+000041506
background set to red.png2012-10-08T21:47:05.000+000043419

Comments

  1. Sabil Rahim 2012-10-10

    master PR https://github.com/appcelerator/titanium_mobile/pull/3150 3.0.X PR https://github.com/appcelerator/titanium_mobile/pull/3151 2.1.X PR https://github.com/appcelerator/titanium_mobile/pull/3152
  2. Natalie Huynh 2012-12-04

    Tested with 3.0.0.v20121130200208 on iPhone 4 5.1.1 and iPhone 5 6.0

JSON Source