Sencha-touch-layout-fit

提供:Dev Guides
移動先:案内検索

Sencha Touch-レイアウトフィット

説明

*Fit* -このレイアウトでは、コンテナは単一のパネルで満たされ、レイアウトに関連する特定の要件がない場合、このレイアウトが使用されます

構文

以下は、フィットレイアウトを使用する簡単な構文です。

layout: 'fit'

以下は、フィットレイアウトの使用法を示す簡単な例です。

<!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>

これにより、次の結果が生成されます–