首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使我的自定义主题加载一个Sencha 2应用程序打包为本机上的iOS模拟器?

如何使我的自定义主题加载一个Sencha 2应用程序打包为本机上的iOS模拟器?
EN

Stack Overflow用户
提问于 2013-01-02 22:24:24
回答 1查看 1.6K关注 0票数 0

我已经在Sencha 2中创建了一个应用程序,并通过与“使用Sencha的主题”教程(http://www.sencha.com/learn/theming-sencha-touch)一起对其进行了主题化。我的CSS加载在开发和生产中。但是,它不会加载到本机中。

我尝试将我的Compass config.rb文件更改为environment=:native,并编译了sass,甚至在app.json中包含了生成的样式表;没有工作。

在iOS模拟器中,除了我的自定义CSS不会修改应用程序的外观(因此,我想它不会加载)外,应用程序在各个方面都会加载和运行。

,我的问题是:,我要做什么才能让我的自定义主题在本地工作?

这是我的index.html:

代码语言:javascript
复制
<!DOCTYPE HTML>
<html manifest="" lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>App</title>
    <!-- The line below must be kept intact for Sencha Command to build your application -->
    <script id="microloader" type="text/javascript" src="touch/microloader/development.js"></script>

</head>
<body></body>
</html>

下面是my //config.rb:

代码语言:javascript
复制
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)

# Load the sencha-touch framework
load File.join(dir, '..', 'touch', 'resources', 'themes')

# Look for any *.scss files in same directory as this file
# Place compiled *.css files in the parent directory
sass_path    = dir
css_path     = File.join(dir, "..")
output_style = :compressed
environment  = :native

这是我的app.json:

代码语言:javascript
复制
{
    /**
     * The application's namespace, used by Sencha Command to generate classes
     */
    "name": "App",

    /**
     * The file path to this application's front HTML document, relative to this app.json file
     */
    "indexHtmlPath": "index.html",

    /**
     * The absolute URL to this application in development environment, i.e: the URL to run this application
     * on your web browser during development, e.g: "http://localhost/myapp/index.html".
     *
     * This value is needed when build to resolve your application's dependencies if it requires server-side resources
     * that are not accessible via file system protocol.
     */
    "url": null,

    /**
     * List of all JavaScript assets in the right execution order.
     * Each item is an object with the following format:
     *      {
     *          "path": "path/to/script.js" // Path to file, if local file it must be relative to this app.json file
     *          "remote": true              // (Optional)
     *                                      // - Defaults to undefined (falsey) to signal a local file which will be copied
     *                                      // - Specify true if this file is a remote file which will not to be copied
     *          "update": "delta"           // (Optional)
     *                                      //  - If not specified, this file will only be loaded once, and
     *                                      //    cached inside localStorage until this value is changed.
     *                                      //  - "delta" to enable over-the-air delta update for this file
     *                                      //  - "full" means full update will be made when this file changes
     *
     *      }
     */
    "js": [
        {
            "path": "touch/sencha-touch.js"
        },
        {
            "path": "app.js",
            "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
            "update": "delta"
        }
    ],

    /**
     * List of all CSS assets in the right inclusion order.
     * Each item is an object with the following format:
     *      {
     *          "path": "path/to/item.css" // Path to file, if local file it must be relative to this app.json file
     *          "remote": true             // (Optional)
     *                                     // - Defaults to undefined (falsey) to signal a local file which will be copied
     *                                     // - Specify true if this file is a remote file which will not to be copied
     *          "update": "delta"          // (Optional)
     *                                     //  - If not specified, this file will only be loaded once, and
     *                                     //    cached inside localStorage until this value is changed to either one below
     *                                     //  - "delta" to enable over-the-air delta update for this file
     *                                     //  - "full" means full update will be made when this file changes
     *
     *      }
     */
    "css": [
        {
            "path": "resources/css/app.css",
            "update": "delta"
        },
        {
            "path": "default-theme.css",
            "update": "delta"
        }
    ],

    /**
     * Used to automatically generate cache.manifest (HTML 5 application cache manifest) file when you build
     */
    "appCache": {
        /**
         * List of items in the CACHE MANIFEST section
         */
        "cache": [
            "index.html"
        ],
        /**
         * List of items in the NETWORK section
         */
        "network": [
            "*"
        ],
        /**
         * List of items in the FALLBACK section
         */
        "fallback": []
    },

    /**
     * Extra resources to be copied along when build
     */
    "resources": [
        "resources/images",
        "resources/icons",
        "resources/startup"
    ],

    /**
     * File / directory name matchers to ignore when copying to the builds, must be valid regular expressions
     */
    "ignore": [
        "\.svn$"
    ],

    /**
     * Directory path to store all previous production builds. Note that the content generated inside this directory
     * must be kept intact for proper generation of deltas between updates
     */
    "archivePath": "archive",

    /**
     * Default paths to build this application to for each environment
     */
    "buildPaths": {
        "testing": "build/testing",
        "production": "build/production",
        "package": "build/package",
        "native": "build/native"
    },

    /**
     * Build options
     */
    "buildOptions": {
        "product": "touch",
        "minVersion": 3,
        "debug": false,
        "logger": false
    },

    /**
     * Uniquely generated id for this application, used as prefix for localStorage keys.
     * Normally you should never change this value.
     */
    "id": "<<<REDACTED>>>"
}

]

EN

回答 1

Stack Overflow用户

发布于 2013-01-04 21:09:12

这里出现了一个答案:http://www.sencha.com/forum/showthread.php?198112-NATIVE-Theming-and-Css。从表单的角度看,它可能是不正确的(也就是说,必须有一种更合适的方法来做到这一点,这与问题中提到的主题Sencha Touch教程是一致的)。然而,解决方案确实有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14130209

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档