如何在flex中设置最小最大宽度以锚定弹出窗口?

时间:2015-11-28 05:48:57

标签: actionscript-3 flex

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

此处AnchorWidthFlag = true且anchorWidth = 350;

我试过这种方式

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

但没有获得适当的输出。

我想将minWidth和maxWidth设置为锚定弹出窗口,有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

尝试将 popUpWidthMatchesAnchorWidth 设置为false,并在 dropDown 组中设置 minWidth maxWidth 。如果我明白你想要什么,那就行了。

在popupAnchor上设置 minWidth / maxWidth 由于弹出窗口不是popupAnchor的子节点而没有任何效果。因此标准的柔性测量步骤在这里不起作用。虽然弹出窗口不知道父 minWidth / maxWidth 。如果打开PopUpAnchor的源代码,您将看到如果popUpWidthMatchesAnchorWidth为true,则弹出窗口的大小设置为popupAnchor的显式大小,但没有关于 minWidth / maxWidth 的代码。如果你真的需要在PopUpAnchor上设置这些大小,你可以扩展PopUpAnchor类并实现这个功能。

相关问题