Spacer image
Before we proceed any further, we should provide Ext with something it needs—a
spacer image. Ext needs a 1 pixel by 1 pixel, transparent, GIF image to stretch in
different ways, giving a fixed width to its widgets. We need to set the location of this
spacer image using the following line:
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'images/s.gif';
});
You're probably wondering why we need a spacer image at all. The user interface of
Ext is created using CSS, but the CSS needs underlying HTML elements to style so
that it can create the look and feel of Ext components. The one HTML element that
is an exact, predictable size across all browsers is an image. So an image is used
to define how an Ext component is drawn. This is a part of how Ext maintains its
cross-browser compatibility.
本文解释了Ext JS框架中Spacer Image的重要性及配置方法。Spacer Image作为一个1x1像素的透明GIF,用于定义组件的绘制方式,确保跨浏览器的一致性表现。通过设置Ext.BLANK_IMAGE_URL路径,实现UI元素的样式创建。
2990

被折叠的 条评论
为什么被折叠?



