我正在尝试使用Sencha Touch 2构建一个可缩放的面板,this 但是,在我应用变换比例之后,就像(假设“mapcontainer”是我需要捏缩放的元素):
Ext.getCmp('mapcontainer').setStyle({
'transform': 'scale(2)',
'-ms-transform': 'scale(2)',
'-webkit-transform':'scale(2)'
});
和dragstart,元素上的比例重置为1.
作为更多信息,我尝试在所有其他事件(包括dragstart)上返回false。但它似乎没有保持规模。
任何想法为什么?
答案 0 :(得分:0)
找出解决方案,但不是原因。 (人?)
基本上我正在扩大容器,但没有增加它的宽度和高度。
所以,最后代码看起来像:
Ext.getCmp('mapcontainer').setHtml("Hello");
Ext.getCmp('mapcontainer').setStyle({
'transform': 'scale(2)',
'-ms-transform': 'scale(2)',
'-webkit-transform':'scale(2)'
});
Ext.getCmp('mapcontainer').setHeight('200%');
Ext.getCmp('mapcontainer').setWidth('200%');
请注意,我们需要执行setHeight和setWidth而不是在setStyle中使用它们,因为这些配置值会覆盖使用CSS设置的值。