Details
-
Type:
Bug
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: Release 3.0.2
-
Fix Version/s: Release 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07
-
Component/s: Android
-
Labels:
-
Environment:
OS: Win7, OSX
IDE: Titanium Studio, build: 2.1.2.201208301612, 3.0.2
Ti API: 2.1.3 GA, 3.0.2 GA
MID: Android 2.3.3, 2.3.6
Description
Problem description
A table with 2 table view sections, each section contains some rows, in each row there's a label and image view. When the user clicks on the image, the image should change to another one, and when the user clicks on the row it should change back. This causes 2 problems on Android only:
1. If user keep click on selection 1 row image and then click on selection 2 same row image, the table will start to to act incorrectly (click on selection1 image row will change selection2 same row image).
2. Sometimes when user click on the row, the image doesn't change back.
Steps to reproduce
Just keep tapping on these two section rows or images, you will see the problem.
Test case
var win1 = Titanium.UI.createWindow({ |
title : 'Tab 1', |
backgroundColor : '#fff' |
});
|
|
var tableView = Titanium.UI.createTableView(); |
|
tableView.addEventListener("click", function(e) { |
if (e.source.sw) { |
e.row.children[1].image = '/KS_nav_views.png' |
} else { |
e.row.children[1].image = '/KS_nav_ui.png' |
}
|
tableView.setData(tableView.getData());
|
//why I have to do this, in order to show the change |
});
|
|
if (Ti.Platform.osname === 'iphone') |
tableView.style = Ti.UI.iPhone.TableViewStyle.GROUPED;
|
|
var tvs = []; |
//------------------------------- tvs1
|
tvs[0] = Ti.UI.createTableViewSection({
|
headerTitle : 'Selection 1' |
});
|
//------------------------------- tvs2
|
tvs[1] = Ti.UI.createTableViewSection({
|
headerTitle : 'Selection 2' |
});
|
|
for ( i = 0; i < 2; i++) { |
for ( j = 0; j < 3; j++) { |
var label = Ti.UI.createLabel({ |
left : 8,
|
text : "Label " + j |
});
|
|
var imgSw = Ti.UI.createImageView({ |
right : 2,
|
height : 48,
|
width : 48,
|
image : '/KS_nav_ui.png', |
sw : true |
});
|
|
var row = Ti.UI.createTableViewRow({ |
height : 48,
|
className : 'row' |
});
|
|
row.add(label);
|
row.add(imgSw);
|
tvs[i].add(row);
|
}
|
}
|
|
tableView.setData(tvs);
|
win1.add(tableView);
|
win1.open();
|