[TIMOB-10570] iOS: TableViewRow: Setting background image of TableViewRow as null or empty does not empty it always
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 2.1.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | api, qe-ios082012 |
Reporter | Satyam Sekhri |
Assignee | Unknown |
Created | 2012-08-23T07:09:26.000+0000 |
Updated | 2018-02-28T20:04:07.000+0000 |
Description
On iOS, Setting background image of TableViewRow as null or empty does not empty it always instead would show the image of earlier emptied row.
This is not a regression. The issue occurs as far as 2.0.1
Steps to Reproduce:
1. Create application with code below and launch the application
2. Click on Row1. BackgroundImage for Row 1 gets set
3. Click on Row2. BackgroundImage for Row 2 gets set
4. Again click on Row1. BackgroundImage for Row 1 gets empty
5. Again click on Row2.
Actual: After Step 5: The row 2 shows the BackgroundImage that was set for Row 1.
Expected: After Step 5: The row 2 should get empty
var _window=Ti.UI.createWindow();
_window.backgroundColor='black';
var TheListBox=Ti.UI.createTableView();
Ti.UI.createTableView({width:'auto'});
var BIRow=Titanium.UI.createTableViewRow({
color:'red',
backgroundColor:"transparent",
title:'No background image...click to toggle'
});
var BIRow2=Ti.UI.createTableViewRow({
color:'red',
backgroundColor:"transparent",
title:'No background image...click to toggle'
});
BIRow.addEventListener('click',function()
//function ToggleBI()
{
if (!BIRow.backgroundImage)
{
BIRow.backgroundImage='appicon.png';
BIRow.title='Titanium background image...click to toggle';
alert('row 1 set');
}
else
{
//BIRow.backgroundImage=null;
BIRow.backgroundImage='';
BIRow.title='No background image...click to toggle';
alert('row 1 unset');
}
});
BIRow2.addEventListener('click',function()
//function ToggleBI2()
{
if (!BIRow2.backgroundImage)
{
BIRow2.backgroundImage='KS_nav_ui.png';
BIRow2.title='Titanium background image...click to toggle';
alert('row 2 set');
}
else
{
BIRow2.backgroundImage=null;
//BIRow2.backgroundImage='';
BIRow2.title='No background image...click to toggle';
alert('row 2 unset');
}
});
TheListBox.appendRow(BIRow);
TheListBox.appendRow(BIRow2);
_window.add(TheListBox);
_window.open();
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0