Sencha Touch - Layout hBox
描述
hbox − 此布局允许元素以水平方式分布。
语法
以下是使用 hbox 布局的简单语法。
layout: 'hbox'
示例
以下是一个简单的示例,展示了 hBox 布局的用法。
<!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() { Ext.create('Ext.Container', { fullscreen: true, layout: 'hbox', items: [ { xtype: 'panel', html: 'message list', flex: 1 }, { xtype: 'panel', html: 'message preview', flex: 2 } ] }); } }); </script> </head> </html>
这将产生以下结果 −