我有两个带有各自视图的选项卡。tabview 本身在滚动视图中。出于某种原因,较大的选项卡不会出现滚动条。我像这样设置(工作)标签视图:
public CustomerTab(Composite arg1, int arg2) throws SQLException {
super(arg1, arg2);
layout = new org.eclipse.swt.layout.GridLayout(GridData.FILL_BOTH, false);
layout.numColumns = 1;
this.setLayout(layout);
一个不会导致滚动条出现的开始是这样的:
public InvoiceTab(Composite parent, int arg2) throws Exception {
super(parent, arg2);
// new gridlayout and asign to this tab
gridLayout = new org.eclipse.swt.layout.GridLayout(GridData.FILL_BOTH, false);
gridLayout.numColumns = 3;
this.setLayout(gridLayout);
在我的应用程序中,我配置了 shell:
@Override protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setSize(1130, 530);
setShellStyle(SWT.SHELL_TRIM & (~SWT.RESIZE));
}
并以这种方式创建滚动视图:
@Override protected Control createContents (Composite parent) {
scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
mainContent = new Composite(scrolledComp, SWT.NONE);
mainContent.setLayout(new FillLayout());
mainTabView = null;
mainTabView = new MainTabView(mainContent);
scrolledComp.setContent(mainContent);
scrolledComp.setExpandHorizontal(true);
scrolledComp.setExpandVertical(true);
scrolledComp.setMinSize(1100, 500);
return mainTabView;
}
发生的情况是,滚动视图只显示 500 条,但下面没有内容,也没有滚动条。谁能看到,我做错了什么?
提前谢谢,马库斯