Scrolling pages & truncated text

You must Login before you can answer or comment on any questions.

I have a page with a view at the top, and then a view for the main "content" both of which contain a label.

if the content label has a lot of text (let's say 3 pages), the page does not scroll automatically.

I changed the content to a scrollview, however if i put the height to auto, i cannot get to the text at the bottom, it sort of goes beyond the end of the page.

given the text is dynamically generated, and can be arbitrarily long, i therefore need to hard code the scrollview to some aritrary really long length so that it always fits, which seems a bit stupid.

am i missing something, i thought the page would scroll automatically if the content was too long for it?

var headingView = Titanium.UI.createView({
                                    height:30,
                                    top: 10,
                                    width: '90%',
                                    });
 
var headingLabel = Titanium.UI.createLabel({
                                    text: 'my heading',
                                    });
myApp.wins[pageId].add(headingView);
headingView.add(headingLabel);
 
var pageView = Titanium.UI.createScrollView({
                                    contentWidth:'auto',
                                    contentHeight:'auto',
                                    top:50,
                                    showVerticalScrollIndicator:true
                                    });
 
var labelView = Titanium.UI.createView({
                                    width: '90%',
                                    height: 'auto', // have to change to 50000 to fit!!
                                    top: 0,
                                    });
 
var pageLabel = Titanium.UI.createLabel({
                                    text:'some really long text',
                                    height: 'auto',
                                    width: '90%',
                                    top: 10,
                                    });
 
win.add(pageView);
pageView.add(labelView);
labelView.add(pageLabel);

— asked 2 years ago by D Moore
0 Comments

Your Answer

Think you can help? Login to answer this question!