2013-06-28 44 views
0

正面臨問題,同時將默認字體更改爲我自己的自定義字體,如Arial或次新的羅馬。我按照教程,但無法得到。我有chabged默認的主題,但無法更改默認的字體。 這裏是代碼小片段供您參考。 app.scss:2.2.0 煎茶CMD:3.1.0.256使用煎茶觸摸版本Sencha touch2:如何將默認字體更改爲我們的自定義字體?

$base-color: #9284b5; // this worked 
    $base-gradient: glossy; // this worked 
    $include-default-icons: false; 
    $font-family: '../fonts/Candara.ttf'; // this didn't work 
    //$font-family:Arial; // this didn't work 
    // The following two lines import the default Sencha Touch theme. If you are building 
    // a new theme, remove them and the add your own CSS on top of the base CSS (which 
    // is already included in your app.json file). 
    @import 'sencha-touch/default'; 
    @import 'sencha-touch/default/all'; 

    // Custom code goes here.. 
    @import 'sencha-touch/default/src/Button'; 
    @import 'sencha-touch/default/src/Class'; 
    @import 'sencha-touch/default/src/Button'; 
    @import 'sencha-touch/default/src/Panel'; 
    @import 'sencha-touch/default/src/Sheet'; 
    @import 'sencha-touch/default/src/MessageBox'; 
    @import 'sencha-touch/default/src/Toolbar'; 
    @import 'sencha-touch/default/src/carousel/Carousel'; 
    @import 'sencha-touch/default/src/form/Panel'; 
    @import 'sencha-touch/default/src/form/FieldSet'; 
    @import 'sencha-touch/default/src/field/Field'; 
    @import 'sencha-touch/default/src/field/Checkbox'; 
    @import 'sencha-touch/default/src/field/Radio'; 
    @import 'sencha-touch/default/src/field/Search'; 
    @import 'sencha-touch/default/src/field/Select'; 
    @import 'sencha-touch/default/src/field/Slider'; 
    @import 'sencha-touch/default/src/field/Spinner'; 
    @import 'sencha-touch/default/src/field/TextArea'; 
    @import 'sencha-touch/default/src/dataview/IndexBar'; 
    @import 'sencha-touch/default/src/dataview/List'; 
    @import 'sencha-touch/default/src/picker/Picker'; 
    @import 'sencha-touch/default/src/plugin/ListPaging'; 
    @import 'sencha-touch/default/src/plugin/PullRefresh'; 
    @import 'sencha-touch/default/src/slider/Slider'; 
    @import 'sencha-touch/default/src/slider/Toggle'; 
    @import 'sencha-touch/default/src/tab/Panel'; 

    // Examples of using the icon mixin: 
    // @include icon('user'); 

上午。 任何人都可以幫我嗎?謝謝。

+0

我跟着下面的鏈接:http://training.figleaf.com/tutorials/senchacomplete/chapter2/lesson11/5.cfm – chipmunk

+2

難道是[這個bug](http://www.sencha.com/forum /showthread.php?261710-font-family-variables-doesn-t-work-since-Touch-2.2)...? –

回答

1

升級到Sencha Touch 2.2.1並解決此問題。

相關問題