Search code examples
apache-flexflex4flex4.5flex-mobile

AutoSizing Flex Mobile spark textarea component


I want to make my mobile spark textarea component to wrap all content. I found out mx_internal way of doing this but I'm not able to call mx_internal::getTextField().numLines method - there's no such... Anybody who has done this before?


Solution

  • Here is a solution for mobile:

    for(var i:int=0; i < StyleableTextField(txt_genel.textDisplay).numLines; i++) {
            ta_height += StyleableTextField(txt_genel.textDisplay).getLineMetrics(i).height;
    }
    txt_genel.height = ta_height;