[TIMOB-6723] Android: TableViewRow fonts change when row is scrolled
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-10-26T22:41:22.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | qe-port |
| Reporter | Arthur Evans |
| Assignee | Karl Rowley |
| Created | 2011-12-16T13:48:50.000+0000 |
| Updated | 2014-06-19T12:44:08.000+0000 |
Description
If one row in a TableView is set to use a unique font, and the tableview is scrolled back and forth, other rows will pick up the improper font.
The following code demonstrates this bug:
Ti.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
title:'Tableview with Filter',
backgroundColor:'#fff'
});
var data = [];
for (var c=0;c<=20;c++) {
data.push({title:"Row "+c});
}
data[3].font = { fontSize: 50, fontWeight: 'bold'};
var tableview = Ti.UI.createTableView({
data:data,
});
win.add(tableview);
win.open();
Note that only one row has the extra-large font. Launch on Android and scroll the list quickly, repeatedly from top to bottom. As you scroll around, you should see one or more rows with the extra-large font size appear.
Duplicate of TIMOB-10712. I have verified that the pull request for TIMOB-10712 resolves this issue.
This is documented as an issue in the API docs: http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TableViewRow-property-font If the PR fixes it, it should also update the docs. Specifically, the following text should be removed from TableViewRow.yml: If the table uses different fonts on different rows, the font properites may become associated with the wrong row as the table scrolls. This is a known issue.
Pull request https://github.com/appcelerator/titanium_mobile/pull/3103 for doc changes.
Resolving -- the pull request for the doc change was approved and closed.
Tested with: SDK:3.1.0.v20130114171802 Studio:3.0.1.201212181159 Device: Samsung galaxy tab(v 3.2) Tableviewrow fonts are consistent while scrolling.