我有一个显示两个标签的标签面板。我还创建了一个Ext.panel.Panel(docspanel),它显示在两个标签中。但是如何隐藏标签B?
tabPanel = Ext.create('Ext.tab.Panel', {
region: 'center',
activeTab: 0,
autoScroll: true,
items: [
{
id:"panel_A",
html: "<iframe src= '"+A_url +"' width='100%' height='100%' id='frm_A' name='frm_A' frameborder=0 />",
},{
id:"panel_B",
html: "<iframe src= '"+B_url+"' width='100%' height='100%' id='frm_B' name='frm_B' frameborder=0 />",
}],
renderTo: Ext.getBody()
});
viewport = new Ext.Viewport({
layout:'border',
items:[tabPanel,docsPanel]
});
答案 0 :(得分:0)
通过这种定义,您的<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppTheme.AppBarOverlay">
<include
layout="@layout/include_layout_toolbar_scroll"/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/include_layout_content_with_nestedscroll"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_task_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_accepted"
app:layout_behavior="pass.to.FabScrollBehavior.Class"
app:theme="@style/Widget.AppTheme.Fab"/>
</android.support.design.widget.CoordinatorLayout>
已添加到docsPanel
(以及标签面板),而不是Ext.Viewport
。
tabPanel
您可以将viewport = new Ext.Viewport({
layout:'border',
items:[tabPanel,docsPanel]
});
添加到面板A,如下所示:
tabPanel
或items: [
{
items: [
docsPanel,
{
xtype: 'panel',
id:"panel_A",
html: "<iframe src= '"+A_url +"' width='100%' height='100%' id='frm_A' name='frm_A' frameborder=0 />"
}
]
},
{
id:"panel_B",
html: "<iframe src= '"+B_url+"' width='100%' height='100%' id='frm_B' name='frm_B' frameborder=0 />"
}
],
/ hide()
show()
tabchange
docsPanel
事件{imone毫无意义}。