Sencha Touch 自定义图标

本文将指导您如何将自定义图标应用于Sencha Touch应用,并通过配置文件和CSS来实现背景色、选中色等样式效果。同时,演示如何在应用中导入并使用Sencha Touch框架组件。

原文:http://sailei1.iteye.com/blog/1630724

首先把你 图标图片放入 E:\space\Theming\sdk\resources\themes\images\default\pictos 目录下 

我放了个 sai.png 
app.scss 
Java代码   收藏代码
  1. $base-color: #ffffff; //背景色  
  2. $active-color: #ea4199; //选中色  
  3.   
  4. @import 'sencha-touch/default/all';  
  5.   
  6. // You may remove any of the following modules that you  
  7. // do not use in order to create a smaller css file.  
  8. @include sencha-panel;  
  9. @include sencha-buttons;  
  10. @include sencha-sheet;  
  11. @include sencha-picker;  
  12. @include sencha-tabs;  
  13. @include sencha-toolbar;  
  14. @include sencha-toolbar-forms;  
  15. @include sencha-indexbar;  
  16. @include sencha-list;  
  17. @include sencha-layout;  
  18. @include sencha-carousel;  
  19. @include sencha-form;  
  20. @include sencha-msgbox;  
  21.   
  22. // Your custom code goes here...  
  23.   
  24. @include pictos-iconmask('sai'); //自定义图标  


config.rb 
Java代码   收藏代码
  1. # Get the directory that this configuration file exists in  
  2. dir = File.dirname(__FILE__)  
  3.   
  4. # Load the sencha-touch framework automatically.  
  5. load File.join(dir, '..''..''sdk''resources''themes')  
  6.   
  7. # Compass configurations  
  8. sass_path = dir  
  9. css_path = File.join(dir, "..""css")  
  10.   
  11. # Require any additional compass plugins here.  
  12. images_dir = File.join(dir, "..""images")  
  13. output_style = :compressed  
  14. environment = :production  

Js代码   收藏代码
  1. {  
  2.                title: 'Get Started',  
  3.                iconCls: 'sai'//关键  
  4.   
  5.                items: [  
  6.                    {  
  7.                        docked: 'top',  
  8.                        xtype: 'titlebar',  
  9.                        title: 'Getting Started'  
  10.                    },  
  11.                    {  
  12.                        xtype: 'video',  
  13.                        url: 'http://av.vimeo.com/64284/137/87347327.mp4?token=1330978144_f9b698fea38cd408d52a2393240c896c',  
  14.                        posterUrl: 'http://b.vimeocdn.com/ts/261/062/261062119_640.jpg'  
  15.                    }  
  16.                ]  
  17.            }  


dos 命令 
    cd  E:\space\Theming\resources\sass 
    compass compile 
持久性的  compass watch 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值