使用cardSwitchAnimation 时布局因方向改变而中断
我对 Sencha Touch 比较陌生,正在开发一个移动应用程序,并且我注意到当我使用 cardSwitchAnimation 在视图之间转换时,方向更改时会出现一些奇怪的情况。
发生的情况是我有几个包含可滚动内容区域的视图;这在带有动画的纵向模式下工作正常,或在横向模式没有动画。当处于横向模式并使用动画时,停靠的项目会消失,并且视图底部有一堆空白。
作为参考,这是我的基本表示层结构:
Viewport
- 扩展 Ext.Panel
- 包含视图对象
- 包含停靠项目
- fullscreen: true
- 布局配置:card
- cardSwitchAnimation: false
Views
- 扩展 Ext.Panel Panel
- 属于 Viewport
- 包含一个可滚动的内容区域
- 布局配置:card
- cardSwitchAnimation: slip
内容区域
- 属于 Views
- xtype: panel
- 滚动:垂直
解决方案我已经尝试过:
- 在onOrientationChange中调用doLayout和doComponentLayout,对于视图和视口
- 将monitorOrientation和onOrientationChange设置为true,对于视图和视口都
- 使用视图的“fit”布局类型(有效,但与过渡动画不兼容)
- 对内容区域使用“适合”布局类型(内容区域由于某种原因折叠)
我正在为此绞尽脑汁,但似乎找不到解决方案。有什么想法吗?
I'm relatively new to Sencha Touch and I'm developing a mobile application, and I've noticed a few quirks that occur on orientation change when I use cardSwitchAnimation to transition between views.
What's happening is that I have several views that contains a scrollable content area; this works fine in portrait mode with the animation, or in landscape mode without the animation. When in landscape mode and using the animation, the docked items disappear and there's a bunch of white space at the bottom of the view.
For reference, here's my basic presentation-layer structure:
Viewport
- Extends Ext.Panel
- Contains view objects
- Contains docked items
- fullscreen: true
- Layout configuration: card
- cardSwitchAnimation: false
Views
- Extend Ext.Panel
- Belong to Viewport
- Contains one scrollable content area
- Layout configuration: card
- cardSwitchAnimation: slide
Content areas
- belong to Views
- xtype: panel
- scroll: vertical
Solutions I've tried:
- calling doLayout and doComponentLayout in onOrientationChange, for both the views and the viewport
- setting monitorOrientation and onOrientationChange to true, for the both the views and the viewport
- using 'fit' layout type for the views (works, but incompatible with the transition animations)
- using 'fit' layout type for the content areas (content area collapses for some reason)
I'm wracking my brain over this and I can't seem to find a solution. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论