Scrolling an editable spark TextArea from Flex Hero Mobile on a touch device
I am having a hard time figuring this out...
How do you scroll an editable TextArea (Flex Hero) on a touch device? I am referring to the situation where the text does not fit in the TextArea height. When I try to tap and drag the text gets selected and not scrolled... Am I missing a something here? I am using verticalScrollPolicy = on (also tried auto).
I am testing the code in the Blackberry Playbook simulator (my targeted device for my app).
If you have any hints or suggestions please let me know开发者_如何学C.
Thanks,
A TextArea is an editable component. You should try using RichText instead if you don't want to edit the text.
Put it in a s:Scroller:
<s:Scroller id="prayerSc" width="100%" height="100%">
<s:RichEditableText id="prayerText" width="100%" height="100%" clipAndEnableScrolling="true" selectable="true" editable="true" textFlow="{PTFL}" />
</s:Scroller>
RichEditableText is not optimized for mobile
Use this instead Orig source
import spark.components.supportClasses.MobileTextField;
private var cnt:int = 0;
protected function addText():void
{
ta.appendText('More text... ' + cnt++ + '\n');
MobileTextField(ta.textDisplay).scrollV++;
}
<s:TextArea id="ta" width="95%" height="200" editable="false"/>
精彩评论