Reputation: 5498
I am working on a Titanium Appcelerator project, a tabbed application with tables. These tables contain a gradient background with a label and an input field. The problem is that on iOS when the row is tapped in the label area, the background color of the row fades to black and then fades back in. This is an old app that I'm updating for the latest iOS devices and Titanium version. It didn't behave this way before, but I have no idea where the change might be. Here are some tidbits where these UI elements are created.
function createRow(obj){
var row;
if (Titanium.Platform.name == 'iPhone OS') {
obj.selectionStyle = Ti.UI.iPhone.TableViewCellSelectionStyle.NONE;
obj.height = 40;
obj.width = 200;
obj.touchEnabled = false;
row = Titanium.UI.createTableViewRow(obj);
} else if (Titanium.Platform.name == 'android'){
obj.touchEnabled = true;
obj.width = Titanium.Platform.displayCaps.platformWidth-8;
if(Titanium.Platform.displayCaps.platformWidth > 320){
obj.height= getAndroidNumbers(40,70);
} else {
obj.height= 40;
}
row = Titanium.UI.createView(obj);
var row2 = Titanium.UI.createView(obj);
row.add(row2);
row2.addEventListener('click',function(e){
Ti.UI.Android.hideSoftKeyboard();
});
row2.addEventListener('swipe',function(e){
Ti.UI.Android.hideSoftKeyboard();
});
row2.addEventListener('touchmove',function(e){
Ti.UI.Android.hideSoftKeyboard();
});
}
return row;
}
Any ideas would be greatly appreciated.
Upvotes: 0
Views: 537
Reputation: 13713
I think what you are talking about is the highlight option of the tableview.
on iPhone to set the highlight (or disable it) you would use the selectionStyle of the tableview. so to disable it you would do:
selectionStyle: Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
on Android try this:
tableView :{
backgroundColor:'transparent',
separatorStyle:'none',
selectionStyle:'none',
separatorColor : 'transparent',
}
Upvotes: 2