[英]How to write a custom component to wrap and resize text automatically (in Flex)?
[英]Flex 4 : How to automatically resize the button based on content?
我想根據其內容(標簽文本)自動調整按鈕(火花按鈕)的大小嗎?
安東尼
如果未顯式定義控件的寬度,則默認情況下應發生這種情況。
ž
一旦您添加Button(...)按鈕,按鈕就會自動調整大小。
好的,我找到了解決方案:-)
public class MyButton extends Button
{
public function MyButton()
{
super();
}
override protected function measure():void
{
super.measure();
this.width = this.measuredWidth;
}
}
現在,我的按鈕始終正確調整大小(寬度)。
謝謝大家
安東尼
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.