1

I have problem with vertical scroll in SPARK text area. I've added simple code in creation complete to insert 200 lines in text area:

private function creationCompleteHandler(event:FlexEvent):void
{
  for (var iind:uint = 1; iind < 200; iind++)
  {
    testTextArea.text += iind.toString() + "\n";
  }
}

And when I start application I noticed that the last 10% (approximately) of scroll bar is "a free walk". When scroll is on 90% page is scrolled all the way down, and when I move thumb of the scroll bar in last 10% of scroll bar nothing moves.

This is all until I change text in text area in browser, then scroll bar acts normal.

Thanks

edit: I tried to dispatch event "change", but it's still not working.

4

1 回答 1

0

在 creationComplete 块中尝试下面,虽然它没有多大意义:

testTextArea.scroller.verticalScrollBar.value =    testTextArea.scroller.verticalScrollBar.maximum;
testTextArea.validateNow();
testTextArea.scroller.verticalScrollBar.value = 0;

然后当你听的时候:

testTextArea.scroller.verticalScrollBar.addEventListener(Event.CHANGE, on Change);

你可以做任何你想做的事:

if(testTextArea.scroller.verticalScrollBar.value >= (testTextArea.scroller.verticalScrollBar.maximum-5))

这当然看起来很hacky!

于 2013-06-11T08:20:53.457 回答