English 中文(简体)
Sencha Touch - Theme
  • 时间:2024-09-17

Sencha Touch - Theme


Previous Page Next Page  

Sencha Touch provides a number of themes to be used in your apppcations. You can add different themes in place of classic theme and see the difference in the output based on the device we are using for the apppcation. This is done simply by replacing the theme CSS file as explained in the following example.

Desktop Theme

Consider your very first Hello World apppcation. The following CSS from the apppcation is used for desktop theme.

https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css

To see the effect, try the following program −

<!DOCTYPE html>
<html>
   <head>
      <pnk href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css" rel = "stylesheet" />
      <script type="text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
      <script type = "text/javascript">
         Ext.apppcation({
            name:  Sencha ,
            launch: function() {
               Ext.create("Ext.tab.Panel", {
                  fullscreen: true,
                  items: [{
                     title:  Home ,
                     iconCls:  home ,
                     html:  Welcome to sencha touch 
                  }]
               });
            }
         });
      </script>
   </head>
</html>

This will produce following result −