Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9466] Android: Scrollview content can think it is bigger then it actually is

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-06-14T11:12:45.000+0000
Affected Version/sRelease 2.0.2
Fix Version/sRelease 2.1.0
ComponentsAndroid
Labelsapi, module_scrollview, parity, qe-testadded
ReporterPaul Hamilton
AssigneeNeeraj Gupta
Created2012-05-23T09:33:51.000+0000
Updated2012-07-03T16:42:18.000+0000

Description

Problem

The scroll content could change dynamically, but if it is very small, it wants to scroll anyway! The scroll height is fine, but it thinks its content is much larger then it actually is? In iOS the Scrollview it won't scroll due to contents are very small.

Tested on

Testing on android

2.0.1GA2, 2.0.2.GA > Droid Razr 2.3.5

Testing on iOS

iOS 5 simulator

app.js

Titanium.UI.setBackgroundColor('#000');
 
var win = Titanium.UI.createWindow({  
    title:'window',
    backgroundColor:'#fff'
});
 
var mainView = Ti.UI.createView({
    layout: 'vertical',
    top: 0,
    width: '100%',
    height: '100%'
})
 
var image1 = Ti.UI.createImageView({
    width: 200,
    height: 200,
    image: "KS_nav_views.png"
})
 
var view = Ti.UI.createView({
    backgroundColor: 'blue',
    height: '100%',
    layout: 'vertical'
});
 
var scroll = Ti.UI.createScrollView({
    backgroundColor: "#444",
    contentHeight: 'auto',
    contentWidth: 'auto',
    height: '50%',
    width: '100%',
    showVerticalScrollIndicator : true,
    layout: 'vertical',
    top : 0
});
 
view.add(scroll);
 
var label = Ti.UI.createLabel({
    text: 'why does this scroll?'
});
 
scroll.add(label);
 
var image2 = Ti.UI.createImageView({
    width: 200,
    height: '25%',
    image: "KS_nav_ui.png",
    bottom : 0
});
 
win.add(mainView);
mainView.add(image1);
mainView.add(view);
win.add(image2);
 
win.open();

Comments

  1. Eduardo Gomez 2012-06-05

    @Paul Hamilton I've pulled a CI build to test this out. The scrollView area doesn't scrolls anymore (likewise iOS 5 - tested on simulator).

    Specifically this is the CI build tested on

       [INFO] logfile = /Users/egomez/Documents/Titanium Studio Workspace/1iPad/build.log
       [DEBUG] /Library/Application Support/Titanium/mobilesdk/osx/2.1.0.v20120520110234/android/builder.py install 1iPad /Users/egomez/android-sdks /Users/egomez/Documents/Titanium Studio Workspace/1iPad com.appcelerator.ipad 8
       [INFO] Titanium SDK version: 2.1.0 (05/20/12 11:02 32b0001)
       
    Having said that, the one can be grab here: http://builds.appcelerator.com.s3.amazonaws.com/index.html I'll leave this open for a while in case you have further questions or some more clarifications.
  2. Paul Hamilton 2012-06-08

    Just tested this with 2.0.2.GA and this is still occurring in the android emulator. Tested using 2.3.3 and 2.2 API. with both 480/320 and 800/480 resolutions.
  3. Paul Hamilton 2012-06-14

    I see what you mean originally. I have never used a CI build before thus i must appologize. I just updated to the most recent 'stable' version (2.0.2). The scrolling issue does seem to be behaving appropriately with CI build 2.1.0.v20120614102250. CI Builds shouldn't give too much trouble i hope? This was giving me major issues with my layout design and using scrollviews that didn't take up the whole screen, but which had to be there when scrolling did occur. Keep up the good work. This can be marked as resolved in 2.1 i think.
  4. Neeraj Gupta 2012-06-14

    This issue has most likely been fixed by another layout PR. Marking it resolved based on filer's comments.
  5. Payminder Singh 2012-06-23

    Titanium Studio: 2.1.0.201206221045 Mobile SDK: 2.1.0.v20120622174154 OS: X Lion Device: Samsung Galaxy Can't reproduce it. No scrolling bar because there is no contents.

JSON Source