This is a migrated thread and some comments may be shown as answers.

Change theme

1 Answer 68 Views
HTML5, CSS, JavaScript
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Theis
Top achievements
Rank 1
Theis asked on 01 Feb 2016, 08:29 PM

I have used the sample app, in this is there a button to change the skin to flat in the button this button starts the function app.changeSkin.

 

The problem i have is that i want the app to start in the flat design, i can not find where this is changed in the project, is it changed somewhere in the project instead of the code?

http://plugins.telerik.com/cordova/plugin/facebook

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 04 Feb 2016, 02:21 PM

Hi Theis,

The Kendo UI mobile Application instance loads a default theme when launched. The themes are located in the kendo.mobile.all.min.css.

To change the theme at start of the program you should define the launching skin that you want when creating the kendo.mobile.Application instance as shown here.

Also, you can alter the skin programmatically using the skin method of the kendo.mobile.Application instance.

A sample code that utilizes both approaches will look like this:

    document.addEventListener('deviceready', function () {
        navigator.splashscreen.hide();
         
        var mobileSkin = "flat";
         
        app.changeSkin = function (e) {
            if (e.sender.element.text() === "Flat") {
                e.sender.element.text("Native");
                mobileSkin = "flat";
            } else {
                e.sender.element.text("Flat");
                mobileSkin = "";
            }
 
            app.application.skin(mobileSkin);
        };
                        
    app.application = new kendo.mobile.Application(document.body, { layout: "tabstrip-layout" ,skin: mobileSkin});
    }, false);

Let me know if this helped.

Regards,

Martin
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
HTML5, CSS, JavaScript
Asked by
Theis
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or