简体   繁体   中英

Extending Flex3's Panel: Calculating Title's Width in Custom Component

Hi I'm extending the Flex 3 panel component. I need to figure out the width of the title's text. Because, title is a private variable in panel, I can't access it via title.width.

I know the font, fontsize (14), and length of the title (which will vary). Knowing this info is there a way to calculate how many pixels wide the title is?

titleTextField is a protected property.You can use it to calculate the textwidth right.

Can you try this and let me know if it works?

measureText(titleTextField.text).width

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM