【Sencha Toucha】Sencha Touch ExtJs 给 Button 添加图片

本文讨论了使用Ruby处理图片时遇到的网络连接问题,通过调整代码配置成功显示图片,并展示了最终实现的效果。

在网上找了很多例子,说ruby加工图片,公司连不上网装不上去,离线研究了半天也没装上。

也有个一样的这样的帖子,发了一个加图片。说是要加BLANK_IMAGE_URL 这个属性,研究了半天。最后弄出来不用加就可以显示。最后效果如下:



ext代码:

Ext.define('app.view.MPktkf', {
	extend : 'Ext.Container',
	xtype : "MPktkf",
	config : {
		fullscreen : true,
		scrollable : true,
		monitorOrientation : true,
		dockedItems : [],
		fullscreen : true,
		layout : 'vbox',
		defaults : {
			padding : 10,
			defaults : {
				margin : 5
			}
		},
		items : [{
			xtype : 'panel',
			html : '<div class="model"><h2 class="sTitle">报表</h2><div id="sSolid"></div></div>'
		}, {
			xtype : 'panel',
			layout : 'hbox',
			items : [{
						xtype : 'button',
						text : ' 按鈕1 ',
						ui : 'normal',
						iconAlign : 'top',
						iconCls : 'bt_kt',
						iconMask : true,
						handler : function onclick() {
						}
					}, {
						xtype : 'button',
						text : '按鈕2',
						ui : 'normal',
						iconAlign : 'top',
						iconCls : 'bt_ycpj',
						iconMask : true,
						handler : function onclick() {
						}
					}, {
						xtype : 'button', 
						text : '按鈕3',
						ui : 'normal',
						iconAlign : 'top',
						iconCls : 'bt_ytkf',
						iconMask : true,
						handler : function onclick() {
						}
					}, {
						xtype : 'button',
						text : '按鈕4',
						ui : 'normal',
						iconAlign : 'top',
						iconCls : 'bt_qtkf',
						iconMask : true,
						handler : function onclick() {
						}
					}]
		}, {
			.......
});


css代码

.bt_kt
{
	background: url(images/spirit-level.png)  left top no-repeat !important;  
	background-size:100% 100%;
	width: 3.1em !important;
	height: 3.1em !important;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值