Sencha Touch 中 doLayout() 和 doComponentLayout() 之间的区别?
正如标题所说,在 Sencha Touch 中调用组件的 doLayout()
和 doComponentLayout()
有什么区别?我尝试查看文档,但它没有清楚地解释这一点。
As the title says, what is the difference between calling doLayout()
and doComponentLayout()
for a component in Sencha Touch? I tried having a look at the documentation, but it did not clearly explain this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两者实际上是截然不同的。
doLayout
是一个容器方法,用于设置容器内子组件的大小。 doComponentLayout 是一种组件方法,用于调整组成该组件的元素(通常)的大小。doLayout
不会显式传播到子容器;但由于布局是 setSize 驱动的,子组件大小的任何更改都会触发相应的 ComponentLayout ->容器布局。The two are actually quite different.
doLayout
is a container method used to set the sizes of child components within the container.doComponentLayout
is a component method used to size the elements (typically) that make up that component.doLayout
does not explicitly propagate to child containers; but since layouts are setSize driven, any changes in size to child components will trigger the appropriate ComponentLayout -> ContainerLayout.