在 Flex 中定义属性的可能值

发布于 2024-07-25 13:23:32 字数 137 浏览 1 评论 0原文

在 Flex 中,是否可以在属性中包含某种元数据,以便能够列出属性可以使用的所有可能值? 我希望能够在从 MXML 调用属性时列出值,例如在属性 enabledvisible 的情况下,用户可以获得以下列表“真假”。

In Flex, is it possible to include some kind of MetaData to a property, to be able to list all possible values that a property can use? I want to be able to list the values when calling the property from MXML, as in the case of for example the property enabled or visible, where the user gets a list of "true/false".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷爱 2024-08-01 13:23:32

使用 Inspectable 元数据标记。 在您的情况下,您需要显式使用枚举属性。

[Inspectable( enumeration="one,two,three" )]
public var myProp:String;

Use the Inspectable metadata tag. In your case you'll want to explicitly use the enumeration attribute.

[Inspectable( enumeration="one,two,three" )]
public var myProp:String;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文