Sencha Touch - Layout Fit



Description

Fit − In this layout, the container is filled with a single panel and when there is no specific requirement related to the layout then this layout is used

Syntax

Following is the simple syntax to use fit layout.

layout: 'fit' 

Example

Following is a simple example showing the usage of fit layout.

<!DOCTYPE html>
<html>
   <head>
      <link 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.application({
            name: 'Sencha', launch: function() {
               var panel = Ext.create('Ext.Panel', {
                  width: 200, height: 200, layout: 'fit', items: {
                     xtype: 'panel', html: 'Also 200px by 200px'
                  }
               });

               Ext.Viewport.add(panel);
            }
         });
      </script>
   </head>
</html>

This will produce following result −

sencha_touch_layout.htm
Advertisements