简体   繁体   中英

how to set min an max width to anchor popup in flex?

if(anchorWidthFlag)  
   {  
     popUp.popUpWidthMatchesAnchorWidth = false;  
     popUp.explicitWidth = anchorWidth;         
   }

here AnchorWidthFlag = true and anchorWidth = 350;

i tried this way

1) popUpWidthMatchesAnchorWidth = false
2) explicitWidth = anchorWidth //350

but not get appropriate output.

I want to set minWidth and maxWidth to anchor popup, can anyone help me?

Try to set popUpWidthMatchesAnchorWidth to false and set minWidth and maxWidth on dropDown group. If I understood what you want, it would work.

Setting minWidth/maxWidth on popupAnchor woudn't make any effect due to the fact, that popup is not a child of popupAnchor. So standard flex measuring steps wouldn't work here. Though popup doesn't know parent minWidth/maxWidth . If you open the source code of PopUpAnchor you will see that if popUpWidthMatchesAnchorWidth is true the size of popup is set to explicit size of the popupAnchor, but there is no code about minWidth/maxWidth . If you really need to set these sizes on PopUpAnchor you would extend PopUpAnchor class and implement this functionality.

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