ImageSwitcher 中的 makeView() 方法有什么用
我创建了一个简单的 ImageSwitcher 来实现 ViewFactory。在我看到的示例中,有一个 makeView() 方法没有显式调用,但如果该方法不存在,则会显示错误。谁能解释一下这个方法的目的。谢谢。
I created a simple ImageSwitcher which implements the ViewFactory. And in the example i have seen, there is a makeView() method which is not called explicitly, but if the method is not present it shows the errors. Can anyone explain me the purpose of this method. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了符合ViewFactory规范,我们需要编写一个
makeView 方法。创建 ImageSwitcher 控件时,可以使用 setFactory() 方法配置 ViewFactory。 ViewFactory 有一个必需的方法,即 makeView() 方法。请注意,视图的源或内容尚未在 makeView() 方法中配置。相反,您可以将其视为 ImageSwitcher 控件将用来显示每个子视图的模板。
In order to comply with the ViewFactory specification, we need to write a
makeView method. When you create a ImageSwitcher control, you can configure ViewFactory using the setFactory() method. ViewFactory has one required method, the makeView() method. Note that the source, or contents, of the view have not been configured in the makeView() method. Instead, you can consider this a template that the ImageSwitcher control will use to display each child view.