简体   繁体   English

如何完成可选的子视图?

[英]How to accomplish a optional childview?

I have a view with two child views, and want the second view optionally to disappear, that is disabled including the dataBinding, and resize the first view, and vice versa. 我有一个带有两个子视图的视图,并希望第二个视图可选地消失,包括dataBinding在内被禁用,并调整第一个视图的大小,反之亦然。 I need some hints or (pseudo) code how to accomplish this. 我需要一些提示或(伪)代码如何实现这一目标。 Thx in advance. Thx提前。

There are quite a few views in SproutCore which do this in some way or another. SproutCore中有很多视图以某种方式执行此操作。 While it is not the best example, have a look at the experimental select search view . 虽然这不是最好的例子,但请查看实验性选择搜索视图

You are going to need to override createChildViews to set up the bindings manually, so you can also take them down when required. 您将需要覆盖createChildViews以手动设置绑定,因此您还可以在需要时将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM