[英]how to set min an max width to anchor popup in flex?
if(anchorWidthFlag)
{
popUp.popUpWidthMatchesAnchorWidth = false;
popUp.explicitWidth = anchorWidth;
}
這里AnchorWidthFlag = true和anchorWidth = 350;
我嘗試過這種方式
1)popUpWidthMatchesAnchorWidth = false
2)explicitWidth = anchorWidth // 350
但沒有得到適當的輸出。
我想將minWidth和maxWidth設置為錨定彈出窗口,有人可以幫助我嗎?
嘗試將popUpWidthMatchesAnchorWidth設置為false,並在dropDown組上設置minWidth和maxWidth 。 如果我了解您的需求,那將奏效。
由於popup不是popupAnchor的子項,因此在popupAnchor上設置minWidth / maxWidth不會產生任何效果。 因此,標准的撓曲測量步驟在這里不起作用。 雖然彈出窗口不知道父級minWidth / maxWidth 。 如果打開PopUpAnchor的源代碼,將會看到如果popUpWidthMatchesAnchorWidth為true,則彈出窗口的大小將設置為popupAnchor的顯式大小,但是沒有關於minWidth / maxWidth的代碼。 如果確實需要在PopUpAnchor上設置這些大小,則可以擴展PopUpAnchor類並實現此功能。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.