[TIMOB-26368] iOS: ScrollView on TableView, Event Listener of ScrollView does not work.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 8.0.0, Release 7.3.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | engSchedule, ios |
Reporter | Andreas Pingas |
Assignee | Vijay Singh |
Created | 2018-09-05T14:03:55.000+0000 |
Updated | 2019-04-17T18:02:20.000+0000 |
Description
Please check the following example.
At the first tab the Event listener does not work properly whereas on the second does.
When it has ScrollView on TableView the Event Listener of ScrollView does not work and at the same time it does not work on any view that is connected on the ScrollView and also on createTableViewRow that ScrollView is connected.
function createView(e) {
var view = Titanium.UI.createView({
height:'400dip',
width:'200dip',
left:'10dip',
right:'10dip',
backgroundColor:e.color
});
view.addEventListener('click', function() {
alert('TEST');
});
return(view);
}
function createTableViewRow() {
var rowView = Titanium.UI.createTableViewRow({
height:'420dip'
});
rowView.addEventListener('click', function() {
alert('TEST');
});
var scrollView = Titanium.UI.createScrollView({
height:'400dip',
width:'400dip',
top:'20dip',
scrollType:'horizontal',
layout:'horizontal'
});
rowView.add(scrollView);
scrollView.add(createView({
color:'#AAA'
}));
scrollView.add(createView({
color:'#EEE'
}));
scrollView.add(createView({
color:'#AAA'
}));
scrollView.add(createView({
color:'#EEE'
}));
return(rowView);
};
function createTableView() {
var rowView = Titanium.UI.createView({
top:'0dip',
height:'420dip'
});
var scrollView = Titanium.UI.createScrollView({
height:'400dip',
width:'400dip',
top:'20dip',
scrollType:'horizontal',
layout:'horizontal'
});
rowView.add(scrollView);
scrollView.add(createView({
color:'#AAA'
}));
scrollView.add(createView({
color:'#EEE'
}));
scrollView.add(createView({
color:'#AAA'
}));
scrollView.add(createView({
color:'#EEE'
}));
return(rowView);
};
var windowA = Ti.UI.createWindow();
var windowB = Ti.UI.createWindow();
var tabA = Ti.UI.createTab({
window:windowA,
title:'Tab A'
});
var tabB = Ti.UI.createTab({
window:windowB,
title:'Tab B'
});
var tabGroup = Titanium.UI.createTabGroup({
tabs:[tabA, tabB]
});
tabGroup.open();
var tableView = Titanium.UI.createTableView();
var tableData = [];
tableData.push(createTableViewRow());
tableView.data = tableData;
windowA.add(tableView);
windowB.add(createTableView());
Attachments
File | Date | Size |
---|---|---|
IMG_0730.mov | 2018-09-06T11:34:50.000+0000 | 5954714 |
It works properly on android. The issue appears only on iOS
[~andreas.pingas], Thanks for sharing with us. Are you experiencing this in all iOS devices? Can you share the screenshot which displays the issue properly?
On all the iOS devices. Please watch the video below. [^IMG_0730.mov]
Hello, I was able to reproduce the issue for iOS. The event listener on the scrollview does not fire when it's on tableview. The issue is only on iOS, Android works fine. Tested on Android emulator and io Simulator with SDK 7.3.0.GA. Thanks
This problem is happening on lower sdk versions e.g < 7.0.0 as well. I'll look in this. Simpler test case from attached test case -
Note - In [table view docs](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView), under section 'Tables and Scroll Views', this type of layouts are discouraged.
Got same here. As workaround I'm listening for 'singletap' on TableView for now.