【问题标题】:Change Sench Touch 2.3 Theme before launch启动前更改 Sench Touch 2.3 主题
【发布时间】:2014-01-28 19:56:20
【问题描述】:

我正在尝试根据 url 参数设置我的 sencha touch 应用程序的主题。

http://myapp/?mythemename

我使用这段代码来获取 css 文件的名称:

launch: function() {
    var requestParams = Ext.Object.fromQueryString(location.search.substring(1));

    var styleSheet = '';

    for (prop in requestParams){
       styleSheet = prop;
    }
 }

问题:现在我有了样式表,我什么时候将它添加到 DOM 中?我假设我需要监听一个表明默认 css 已添加到 DOM 的事件,以便我可以删除它并添加我的主题。我要监听什么事件?

【问题讨论】:

    标签: extjs sencha-touch sencha-touch-theming


    【解决方案1】:

    您只需将 Sencha 主题与该主题一起添加到您的 app.json 文件和平台名称中。

    "css": [
        {
            "path": "resources/css/sencha-touch.css",
            "platform": ["chrome", "safari", "ios", "ios-classic", "android", "firefox"]
        },
        {
            "path": "resources/css/my-theme.css",
            "platform": ["mytheme"]
        }
    ]
    

    要更改它,您只需要传递一个名为 platform 的查询字符串 [http://myapp/?platform=mytheme]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多