Flex 设计视图不适用于具有自定义基类的组件
我有一个 Flex 组件,它不是直接从 Canvas 继承,而是从我编写的自定义类 (MyBaseComponent ) 继承,而该类又从 Canvas 继承:
Canvas > 我的基础组件> MyComponent (mxml)
设计视图不适用于此控件。 我只是得到一个空白的灰屏。 (如果我使用 Canvas 而不是自定义基类,它就可以工作。)没有错误,项目编译和运行得很好。
具有自定义基类的应用程序可以在设计视图中工作,那么为什么组件不能呢? 在这种情况下有什么特别的事情必须做吗?
我的组件的 mxml 如下所示:
<?xml version="1.0" encoding="utf-8"?>
<Custom:MyBaseComponent xmlns:mx="http://www.adobe.com/2006/mxml" width="614" height="282" xmlns:Custom="MyCustomLib.*">
...
</Custom:MyBaseComponent>
I have a Flex component that, instead of inheriting directly from Canvas, inherits from a custom class (MyBaseComponent ) that I wrote which in turn inherits from Canvas:
Canvas > MyBaseComponent > MyComponent (mxml)
Design view does not work for this control. I just get a blank gray screen. (It works if I use Canvas instead of my custom base class.) There are no errors and the project compiles and runs just fine.
Applications with custom base classes work in design view, so why not components? Is there something special that must be done in this case?
Here is how my component's mxml looks:
<?xml version="1.0" encoding="utf-8"?>
<Custom:MyBaseComponent xmlns:mx="http://www.adobe.com/2006/mxml" width="614" height="282" xmlns:Custom="MyCustomLib.*">
...
</Custom:MyBaseComponent>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的,它们不起作用,永远不会回到 Flex Builder 2 beta 版本。
这实际上是我第一篇博客文章的主题。 如果您有兴趣,它有一个可行的解决方法,但在这里发布有点长:
http://www.rogue-development.com/blog2/2007/03/code-in-front/
You are correct, they don't work, never have all the way back the the Flex Builder 2 betas.
This was actually the topic of my first blog post ever. It has a hacky workaround that kind works if you're interested, but it's a bit long to post here:
http://www.rogue-development.com/blog2/2007/03/code-in-front/