What's the best way to have a vertical scrolling page
SOLVED
This is probably a total newbie question, but I'm going to ask anyway.
I have a view where the text content exceeds the height allowed (it's not a list of items, just one big blob of text - a label to be more specific). What's the best way to display that content so a user can scroll down to see the bottom of the text.
I'm pretty sure a webview would work, but was trying not to use webviews due to the memory overhead caused by the browser.
What do you guys think?
6 Answers
-
i would just say a regular view?
-
I think just a normal view would work, with auto height on the label:
var label = Titanium.UI.createLabel({ text: 'all your long text', height: 'auto' });
-
This may not be the best way, but similar to the Snapost demo, I have one main view and then am loading views into the main view. Is this not the way to do things any more? I've attempted to put height:'auto' on the label and on the respective views with no luck. Any other ideas?
-
Found an answer.
var viewContainer = Titanium.UI.createScrollView({ contentWidth:'auto', contentHeight:'auto', top:55, showVerticalScrollIndicator:true, showHorizontalScrollIndicator:true });
-
I have the solution and it will only be $29.00 at http://.. JK!
this.view1 = Titanium.UI.createScrollView({ contentWidth:'auto', contentHeight:'auto', showVerticalScrollIndicator:true, showHorizontalScrollIndicator:true }); this.label1 = Titanium.UI.createLabel({ color:'#fff', text: "", width: 310, font:{fontSize:30,fontFamily:'Helvetica Neue'}, height: 'auto' }); this.view1.add(this.label1); this.win1.add(this.view1);
-
I have the solution and it will only be $29.00 at http://.. JK!
this.view1 = Titanium.UI.createScrollView({ contentWidth:'auto', contentHeight:'auto', showVerticalScrollIndicator:true, showHorizontalScrollIndicator:true }); this.label1 = Titanium.UI.createLabel({ color:'#fff', text: "", width: 310, font:{fontSize:30,fontFamily:'Helvetica Neue'}, height: 'auto' }); this.view1.add(this.label1); this.win1.add(this.view1);