Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6723] Android: TableViewRow fonts change when row is scrolled

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-26T22:41:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsqe-port
ReporterArthur Evans
AssigneeKarl Rowley
Created2011-12-16T13:48:50.000+0000
Updated2014-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.

Comments

  1. Karl Rowley 2012-09-26

    Duplicate of TIMOB-10712. I have verified that the pull request for TIMOB-10712 resolves this issue.
  2. Arthur Evans 2012-09-26

    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.
  3. Karl Rowley 2012-10-09

    Pull request https://github.com/appcelerator/titanium_mobile/pull/3103 for doc changes.
  4. Karl Rowley 2012-10-26

    Resolving -- the pull request for the doc change was approved and closed.
  5. Anshu Mittal 2013-01-22

    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.

JSON Source