When I open the app and scroll the table view up and release it, the content on the first row moves to right. Please see the attached screenshot depicting the issue.
Also included three images which need to be attached in project resource folder before running it.
Note : Also if i don't include these three images in my project and run it without any images it runs fine on iOS7 also.
This issue is with iOS 7 only and it work fine on iOS 6.
var appWindow = Ti.UI.createWindow({
height:Ti.UI.FILL,
width:Ti.UI.FILL,
backgroundColor:'#FFFFFF'
});
var tableView = Ti.UI.createTableView({
separatorStyle:'NONE',
backgroundColor:'#FFFFFF'
});
var data = [{title:"App 1",count:"3"},
{title:"App 2",count:"6"},
{title:"App 3",count:"3"},
{title:"App 4",count:"6"},
{title:"App 5",count:"4"},
{title:"App 6",count:"2"}];
var customRow =[];
for(var i=0;i<data.length;i++)
{
customRow[i] = CustomRow_withCount(data[i]);
tableView.appendRow(customRow[i]);
}
function CustomRow_withCount(_obj){
var countView=Ti.UI.createLabel({
right:5,
height:26,
width:36,
backgroundImage:'countImage.png',
color:'#000000',
font:{fontSize:12,fontWeight:'bold',fontFamily:'arial'},
textAlign:'center',
text:_obj.count,
});
var text_label= Ti.UI.createLabel({
left:20,
height:26,
width:200,
color:'black',
font:{fontSize:16,fontWeight:'bold',fontFamily:'arial'},
text:_obj.title,
});
var row = Ti.UI.createTableViewRow({
rightImage:'arrow.png',
backgroundImage:'row_backgrnd.png',
height:40
});
row.add(text_label);
row.add(countView);
return row;
}
appWindow.add(tableView);
var navGroup = Ti.UI.iPhone.createNavigationGroup({
window:appWindow,
backgroundColor:'transparent',
});
var main = Ti.UI.createWindow();
main.fullscreen= true;
main.add(navGroup);
main.open();
Just tested this and can confirm the bug. As a note: I also tried using hasChild:true instead of the custom rightImage and get the same result with the top row moved to the right after scrolling off and on the screen. Also tried setting a unique className to each row, to no avail. When no rightImage or hasChild is set, the table appears correctly. The bug is also present when only the hasChild is true, and also omitting the countView all together. There's definitely something very wrong here. I would mark this issue as critical.
Just a note to Rupesh: createNavigationGroup is being deprecated. A navigationWindow should now be used. See : http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.iOS.NavigationWindow Though, this did not affect the outcome of the issue at hand.
[~kosso] Noted. We are planning on fixing it for the next release.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4834
Tested and verified fix with: OSX: 10.8.5 Xcode:5.0 Appcelerator Studio: 3.2.0.201311122045 SDK: 3.2.0.v20131112180422 acs:1.0.7 alloy:1.3.0 npm:1.3.2 titanium:3.2.0 titanium-code-processo:1.0.3 Device: iOS7(v7.0.3)-iPodTouch1
Test Case Code: {Code} var appWindow = Ti.UI.createWindow({ height:Ti.UI.FILL, width:Ti.UI.FILL, backgroundColor:'red' }); var tableView = Ti.UI.createTableView({ separatorStyle:'NONE', backgroundColor:'#FFFFFF' }); var data = [{title:"App 1",count:"3"}, {title:"App 2",count:"6"}, {title:"App 3",count:"3"}, {title:"App 4",count:"6"}, {title:"App 5",count:"4"}, {title:"App 6",count:"2"}]; var customRow =[]; for(var i=0;i