动态添加/删除地区布局 [英] Dynamically add/remove regions to a layout

查看:139
本文介绍了动态添加/删除地区布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以动态地添加和删除地区与木偶的布局?我的应用程序需要能够从布局推动和流行地区。当你在一个项目的源$ C ​​$ C钻取这类似于GitHub上如何推动和持久性有机污染物的看法。他们对动画的幻灯片时presenting下一个视图,然后将其滑回,当你打了退堂鼓。这个想法是,我需要保持周围的previous意见。另一个比喻是UINavigationControllers iOS上是如何工作的。

Is it possible to dynamically add and remove regions to a layout with Marionette? My app needs to be able to push and pop regions from a layout. This is similar to how GitHub pushes and pops views when you drill down in the source code of a project. They have the slide over animation when presenting the next view and then it slides back when you're backing out. The idea is that I need to keep the previous views around. Another analogy would be how UINavigationControllers work on iOS.

或者,也许我应该只是定义了一个自定义布局,能够处理动态添加和删除地区?

Or maybe I should just define a custom layout that is able to handle adding and removing regions on the fly?

推荐答案

我最终实现一个容器,以适合我的需要。像你的木偶期望它清理事件裁判。

I ended up implementing a container view to fit my needs. It cleans up event refs like you'd expect in Marionette.

<一个href=\"https://github.com/ayoung/backbone-vs-marionette/blob/marionette/public/js/views/mainContainer.js\" rel=\"nofollow\">https://github.com/ayoung/backbone-vs-marionette/blob/marionette/public/js/views/mainContainer.js

这篇关于动态添加/删除地区布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆