Sencha touch Panel之间的跳转(如不使用TabPanel或者Carousel控件而产生跳转的动画效果)
2014-06-10 17:35
633 查看
常规的Sencha touch 应用都是"header content footer"结构,这样的结构无疑将使用TabPanel来实现,而且TabPanel肯定是card布局,这样就会如果要实现"view"之间的跳转,animateActiveItem()方法将被使用,
但是通过st的源码
我们可以轻易的发现这个方法仅限于在Card布局中适用,
那么我们常常要是想做一个单一的panel时,来使用动画跳转.我们的应用要是不使用这样的容器来实现怎么办呢?
这里我们就需要使用一个整体的Panel(Main.js)来组织其他的Panel :
这样首先加载的将是"
但是通过st的源码
animateActiveItem: function(activeItem, animation) { var layout = this.getLayout(), defaultAnimation; if (this.activeItemAnimation) { this.activeItemAnimation.destroy(); } this.activeItemAnimation = animation = new Ext.fx.layout.Card(animation); if (animation && layout.isCard) { animation.setLayout(layout); defaultAnimation = layout.getAnimation(); if (defaultAnimation) { defaultAnimation.disable(); } animation.on('animationend', function() { if (defaultAnimation) { defaultAnimation.enable(); } animation.destroy(); }, this); } return this.setActiveItem(activeItem); }
我们可以轻易的发现这个方法仅限于在Card布局中适用,
那么我们常常要是想做一个单一的panel时,来使用动画跳转.我们的应用要是不使用这样的容器来实现怎么办呢?
这里我们就需要使用一个整体的Panel(Main.js)来组织其他的Panel :
var panel = Ext.create('Ext.Panel', { layout: 'card', items: [ { html: "Your Firse Panel xtype name" }, { html: "Your Second Panel xtype name" }, { html: "Your Third Panel xtype name" } ] }); panel.setActiveItem(0);
这样首先加载的将是"
Your Firse Panel xtype" 如果需要跳转这里需要注意的是.要使用该View设置其的setActiveItem("xtype name") 或者 animateActiveItem("xtype name"); over!
相关文章推荐
- 【sencha-touch】TabPanel的使用
- senchatouch tabPanel 在面板跳转时执行自定义函数 handler()
- 如何使用sencha-touch控件显示平板上的tab界面
- Sencha Touch中TabPanel组件的使用
- sencha 2.0 的tabpanel中使用formpanel,carousel 等的用法
- Silverlight Telerik控件学习:TreeView数据绑定并初始化选中状态、PanelBar的Accordion效果、TabPanel、Frame基本使用
- sencha touch TabPanel 加入导航按钮(向左向右按钮) 以及Carousel插件(2014-11-7)
- Sencha Touch中TabPanel组件的使用(转)
- Android TabActivity与Activity之间的动画跳转(主要Tabhost中跳转出来的动画效果解决)
- Sencha Touch 1.x 为tabPanel添加一个更多按钮。
- 使用 Ext.Net TreePanel,TabPanel控件 布局
- 使用Ext.net时如何遍历Panel或者FormPanel中Content标签下的控件,并进行验证
- Sencha touch 开发系列:容器组件:tabpanel,carousels
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- sencha touch中实现页面之间的互相跳转
- sencha-touch 1.1 Picker控件使用
- Sencha Touch 2 快速入门系列(四)-- 组件之标签面板(TabPanel)
- [全文下载/试读]补充,上集Ch. 3 -- Panel控件与常用属性,范例:问卷系统,动态产生「子问题」(使用障眼法)
- Sencha Touch 2.0 组件:Carousels、List、TabPanel 之用法简介