Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8935] iOS: TableViewRow not changing background image/color

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNeeds more info
Resolution Date2012-06-04T21:26:00.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsiOS
Labelsapi
ReporterPablo Albrecht
AssigneeShak Hossain
Created2012-04-10T05:49:40.000+0000
Updated2017-03-16T20:46:24.000+0000

Description

If you create a table with the attribute selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE, I found an issue that we've been able to fix in such an ugly way that I decided to post the issue here.
var table = Ti.UI.createTableView({ separatorStyle:Ti.UI.iPhone.TableViewSeparatorStyle.NONE,selectionStyle:Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE, backgroundImage:...,backgroundColor:'transparent'});

r = array();

r.push( Ti.UI.createTableViewRow(backgroundImage:'...',...) );

table.setData(r);

randomButton.addEventListener('click',function(e){
    e.row.backgroundImage = 'otherRandomImage.png';

    // This DOESN'T work so here's the fix we found:
    // e.row.hide();
    // e.row.show();
});

If you change the selectionStyle for the default one, it works better but it's still weird the way it changes the picture. Hope this helps :)

Comments

  1. Vishal Duggal 2012-06-04

    The code provided can not run. The bug description is less than helpful. Assigning to Shak since this originated from his team
  2. Pablo Albrecht 2012-06-19

    Dude... seriously ? 2.0.2GA and it still doesn't work, I could reproduce it in 3:20 mins (assuming the IDE is already open). Now it's even worst because we can't just refresh the row rendering by doing e.row.hide() and e.row.show() so it just doesn't work...
  3. Thierry Godfroid 2013-06-26

    Seriously, indeed... Entirely reproducible under 3.0.2GA. Just spent 2h going crazy trying to fix this one. Workaround shown by Pablo works a treat. Titanium Command-Line Interface, CLI version 3.0.24, Titanium SDK version 3.0.2.GA Operating System Name = Mac OS X Version = 10.8.4 node.js node.js Version = v0.8.22 npm Version = 1.2.14 Xcode 4.6.3 (build 4H1503) iOS SDKs = 6.1 iOS Simulators = 6.1
  4. Mindwarp 2013-09-20

    Still not fixed in 3.1.1.GA. Is anybody actually following this thread or does it need a new ticket?
  5. Lee Morris 2017-03-16

    Closing ticket as the information that was requested was never provided.

JSON Source