A mapview in a scrollview should not leave behind a black box when scrolled.
This works in Android 4.x but NOT in Android 2.3.x
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var vert = Ti.UI.createScrollView({
contentHeight: 'auto',
scrollType: 'vertical',
showVerticalScrollIndicator: true,
layout:'vertical',
canCancelEvents: false,
width: Ti.UI.SIZE
});
var mapview = MapModule.createView({
height: 250,
mapType: MapModule.NORMAL_TYPE,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
});
vert.add(Ti.UI.createView({
height: 200, width: 100, backgroundColor: 'red'
}))
vert.add(Ti.UI.createView({
height: 150, width: 100, backgroundColor: 'blue'
}))
vert.add(mapview);
vert.add(Ti.UI.createView({
height: 300, width: 100, backgroundColor: 'green'
}))
win.add(vert);
win.open();
Martin, It is generally not good code practice to have a map view within a scroll view. Good coding practices suggest having a mapview in its own window. If you want the ability to have a map within a scrolling view, it is suggested to use a web view to achieve this. Is there a specific reason why you need to have a map view within a scroll view? Regards, Carter
Hi Carter, Thanks for your answer. I attached you a screenshot from the iphone window. I want to show the user a quick overview how far the current location is from the shown place. Regards, Martin
Martin, Would you mind adding the screenshots of the working behavior in android 4.x and the broken behavior in 2.3.x while I look into this? Thanks, Carter
I spoke to engineering about this issue and they informed me that the method of having scroll views within scroll views will not work (100% of the time) in android. The way that views are nested in the android OS does not permit flawless implementation of nested scroll views. For this reason, we cannot support this method. This isn't an issue with the Titanium platform, rather a limitation applied by the Android SDK. So unfortunately we are unable fix this problem from our end. Regards, Carter