Sencha Touch - 选项卡面板布局

发布于 2024-12-05 19:03:52 字数 455 浏览 4 评论 0 原文

请参阅演示:http://jsfiddle.net/JeaffreyGilbert/NGrry/1/

在此处输入图像描述

如何使选项卡面板的内容填充中心区域?标题应该位于工具栏的顶部、下方。

预期布局: http://dev.sencha.com/deploy/touch/examples/厨房水槽/。我认为源代码并不完整,只有 tabPanel 本身。

请帮忙。

Please see the demo: http://jsfiddle.net/JeaffreyGilbert/NGrry/1/

enter image description here

How to make content of tab panel fill the center area? The heading should be on the top, below toolbar.

Expected layout: http://dev.sencha.com/deploy/touch/examples/kitchensink/. I think the Source isn't complete, only the tabPanel itself.

Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹂绝世的画 2024-12-12 19:03:52

通常要进行这种布局,我必须嵌套面板并使用将 flex 属性设置为 1 的空面板。

我调整了您的代码以显示我的意思 http://jsfiddle.net/r9c2M/

例如,为了将文本“Home”置于工具栏标题下方的中心,我将第一个选项卡面板项更改为

{
    title: 'Home',
    layout: 'vbox',
    items: [
        {layout: 'hbox',
         items: [
            {flex: 1},
            {html: '<h2>Home</h2>'},
            {flex: 1}
        ]},
        {flex: 1}
    ],
    iconCls: 'home',
    cls: 'card card1'}

另外选项卡面板应该只是主要的视口面板,而不是停靠项。这也打乱了布局。

Usually to do that sort of layout I've had to nest panels and use empty panels with the flex attribute set to 1.

I adjusted your code to show what I mean http://jsfiddle.net/r9c2M/

For example to center the text 'Home' underneath the toolbar title I changed the first tabpanel item to

{
    title: 'Home',
    layout: 'vbox',
    items: [
        {layout: 'hbox',
         items: [
            {flex: 1},
            {html: '<h2>Home</h2>'},
            {flex: 1}
        ]},
        {flex: 1}
    ],
    iconCls: 'home',
    cls: 'card card1'}

Also the tabpanel should just be an item of the main viewport panel, not a dockedItem. That was messing up the layout too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文