1
votes

I have a scroll view which has a content height to auto
and inside of it i have a view which contain all the UI element i'm using
but my problem is when i set the height of the view to Ti.UI.SIZE

the scroll view not scrolled it's just scrolled in case of i add a fixed number e.g. 2000 to the child view height

Here is the code

var scrollView = Ti.UI.createScrollView({
    contentWidth : 'auto',
    contentHeight : 'auto',
    backgroundColor : '#fff',
    showVerticalScrollIndicator : false,
    showHorizontalScrollIndicator : false,
    height : "100%",
    width : "100%",
    top : 36.6
});

var view = Ti.UI.createView({
    backgroundColor : '#fff',
    borderRadius : 0,
    height :Ti.UI.SIZE,
    width : Ti.UI.FILL
});

i don't any extra space at the bottom of the view so how i can accomplish this ,and thanks in advance

2
Do you add anything else in your view?turtle
yes i added labels ,slider amd textfeildAntwan
Can you paste the whole code, cause scrollview will only scroll when the data( i.e views, label, etc ) overflows the screen.turtle
I had a similar problem and I ended up with avoiding 'Ti.UI.SIZE' and manipulated the height of the child view in my js code whenever a child view was added. Maybe you will find another solution since the one I used results in really messy code but at least it worked for me!Robin Ellerkmann
thanks @RobinEllerkmann it worked for me now but i got another problem is that the layout became too slowAntwan

2 Answers

1
votes

i have fixed my problem with this

 var padding_view = Ti.UI.createView({
    backgroundColor : "transparent",
    top : "36.6dp",
    left : "11dp",
    right : "11dp",
    bottom:"0dp",
});
var scrollView = Ti.UI.createScrollView({
    contentWidth : '100%',
    contentHeight : 'auto',
    backgroundColor : '#fff',
    showVerticalScrollIndicator : false,
    showHorizontalScrollIndicator : false,
    top : "36.6dp",
    bottom:"22dp",
});

var view = Ti.UI.createView({
    backgroundColor : '#fff',
    height :Ti.UI.SIZE, 
    width : Ti.UI.SIZE
});
0
votes

Try It:

var scrollView = Ti.UI.createScrollView({
    contentWidth : 'auto',
    contentHeight : 'auto',
    backgroundColor : '#fff',
    showVerticalScrollIndicator : false,
    showHorizontalScrollIndicator : false,
    height: Titanium.UI.FILL,
    width : "100%",
    top : 36.6
});

var view = Ti.UI.createView({
    backgroundColor : '#fff',
    borderRadius : 0,
    height :Ti.UI.SIZE,
    width : Ti.UI.FILL
});