-
21 Aug 2012 4:56 AM #1
Unanswered: hideAnimation and showAnimation
Unanswered: hideAnimation and showAnimation
I'd like to simulation modal view animation on iPhone, and here is my code
the code works, but when showing the second panel, the first one hides immediately leaving a white background, so I want to hide it with delay or fade.Code:Ext.define("test.view.Main", { extend: 'Ext.Panel', id: 'MainView', requires: [ ], config: { layout: 'card', items: [ { xtype: 'panel', style: 'background: blue', /* hideAnimation: { type: 'fade', out: true }, */ items: [ { xtype: 'button', text: 'panel2', handler: function() { this.up('#MainView').setActiveItem(1); } } ] }, { xtype: 'panel', style: 'background: red', showAnimation: { type: 'slide', direction: 'up' }, hideAnimation: { type: 'slide', direction: 'down' }, items: [ { xtype: 'button', text: 'close', handler: function() { this.up('#MainView').setActiveItem(0); } } ] } ] } });
but when I comment out the hideAnimation code of the first panel, the second panel shows without animation.
Is this a feature or bug? Thanks in advance.
-
21 Aug 2012 5:22 AM #2
try this...
try this...
Code:{ xtype: 'button', text: 'close', handler: function() { this.up('#MainView').animateActiveItem(1,{type:'slide', direction:'left'}); } }
-
21 Aug 2012 7:09 AM #3
-
21 Aug 2012 7:10 AM #4
-
21 Aug 2012 7:36 AM #5
Its working.....
Its working.....
Code:layout: 'card', items: [ { xtype: 'panel', style: 'background: blue', items: [ { xtype: 'button', text: 'panel2', handler: function() { Ext.getCmp('MainView').animateActiveItem(1,{type:'slide', direction:'left'}); } } ] }, { xtype: 'panel', style: 'background: red', items: [ { xtype: 'button', text: 'close', handler: function() { Ext.getCmp('MainView').animateActiveItem(0,{type:'slide', direction:'right'}); } } ] } ]
-
21 Aug 2012 8:38 PM #6
Thanks, and I've tested your code.
It slides out the old panel instead of covering it ...


Reply With Quote