Sencha-touch-layout-card

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

Sencha Touch-レイアウトカード

説明

カード-このレイアウトは、さまざまなコンポーネントをタブ形式で配置します。 コンテナの上部にタブが表示されます。 常に1つのタブのみが表示され、各タブは異なるコンポーネントと見なされます。

構文

以下は、カードレイアウトを使用する簡単な構文です。

layout: 'card'

以下は、カードレイアウトの使用方法を示す簡単な例です。

<!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', {
                  layout: 'card', items: [
                     {
                        html: "First Item index value is 0"
                     },
                     {
                        html: "Second Item index value is 1 which we are setting as active index"
                     },
                     {
                        html: "Third Item index value is 2"
                     },
                     {
                        html: "Fourth Item index value is 3"
                     }
                  ]
               });
               panel.setActiveItem(1);
               Ext.Viewport.add(panel);
            }
         });
      </script>
   </head>
   <body>
   </body>
</html>

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