[TIMOB-13494] Android: Image View does not maintain image boundary
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-06-07T23:16:24.000+0000 |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | Titanium, android, exalture, mobilesdk, supportTeam |
Reporter | Ashish Nigam |
Assignee | Sunila |
Created | 2013-04-09T07:26:44.000+0000 |
Updated | 2017-03-21T22:43:25.000+0000 |
Description
When we zoom in or out an image in Image View using enableZoomControls property,
then image can be slide out of the image view and there is not way to restrict this behavior.
Steps to reproduce:
1: Launch the sample code present in the JIRA in Android App Project
2: Tap on the image and move your finger in any direction, for example to right. You should be able to see part image and part green.
3: Lift up your finder.
4: Tap on the image again and move the image to the right. Move it unless the image disappears.
5: Lift up for your finger.
Now you will find that the image is no longer visible. Only the green color background is visible.
*sample Code*
var win = Titanium.UI.createWindow({
exitOnClose : true,
navBarHidden : true
});
var parentView = Titanium.UI.createView({
left : 0,
top : 0,
width : '100%',
height : '80%',
backgroundColor : 'red'
});
var imageView = Titanium.UI.createImageView({
left : 0,
top : 0,
width : "150dp",
height : "100dp",
image : 'taman.jpg',
canScale : true,
enableZoomControls : true,
backgroundColor : 'green'
});
imageView.addEventListener("touchmove",function(e){
});
parentView.add(imageView);
win.add(parentView);
win.open();
Behavior implemented If the image is in the original size, scrolling is not allowed If the image is zoomed in, then it can be scrolled until the boundaries, images cannot be scrolled beyond the boundaries.
Closing ticket as duplicate with reference to the above comments.