多个代号一个CSS [英] Multiple Codename One CSS

查看:61
本文介绍了多个代号一个CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在同一个代号一个项目中是否可以使用更多CSS?

Is it possible to use more CSSes in the same Codename One project?

用例1:我希望在应用的不同部分使用不同的样式,或者想要

Use case 1: I want different styles in different parts of the app or I want to replace at all the current styling.

用例2:我希望当前样式是从多个CSS派生的,例如在网页中

Use case 2: I want that the current style is derived from several CSSes, like in a web page

推荐答案

集成在插件中的CSS实现中目前不支持该功能。旧的实现允许这样做,但是我们简化了一些事情,因此转换过程会很流畅。

There is currently no support for that in the CSS implementation that's integrated into the plugin. The old implementation allowed that but we simplified some things so the conversion process will be fluid.

由于Codename内部支持多个资源文件和分层主题,因此这应该很容易实现。我猜在 build.xml 中可能是这样的:

Since multiple resource files and layered themes are supported internally by Codename One this should probably be easy to accomplish. I'm guessing something like this in the build.xml might work:

<target name="-cn1-compile-css" if="codename1.cssTheme">
        <java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
            <jvmarg value="-Dcli=true"/>
            <arg value="-css"/>
            <arg file="css/theme.css"/>
            <arg file="src/theme.res"/>
        </java>
        <java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
            <jvmarg value="-Dcli=true"/>
            <arg value="-css"/>
            <arg file="css/second-theme.css"/>
            <arg file="src/second-theme.res"/>
        </java>
    </target>
</project>

这篇关于多个代号一个CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆