[AC-3014] CreateTableView Style
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-01T08:17:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Brandon Fuller |
Assignee | Eduardo Gomez |
Created | 2012-04-20T18:29:37.000+0000 |
Updated | 2016-03-08T07:48:02.000+0000 |
Description
I was stuck on this weird behavior today where my table view would not show the iOS pinstrip background behind my tableview on the 2nd and most after that views. It always showed on the first.
Here was my code:
var tableview = Titanium.UI.createTableView({
data: data
});
if (isApple())
{
tableview.style = Titanium.UI.iPhone.TableViewStyle.GROUPED;
}
Through trial and error I found out that this worked properly:
if (isApple())
{
var tableview = Titanium.UI.createTableView({
data: data
style: Titanium.UI.iPhone.TableViewStyle.GROUPED;
});
}
else
{
var tableview = Titanium.UI.createTableView({
data: data
});
}
So why does it matter if I set the property in the create or after?
Can you provide the SDK version?
2.0.1.GA2
See this sample it works:
Setting _style_ worked both ways (at instantiation or through property).
Tested on
Titanium SDK 2.0.1.GA2 iOS 5 Simulator