我有两个标签有自己的相应的意见。 tabview本身在滚动视图中。出于某种原因,滚动条不出现在较大的选项卡上。我设置了像这样的(工作)TabView的:SWT/JFace滚动查看不滚动
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);
在我的申请,我配置了壳:
@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到,但没有下面的内容,没有滚动条。任何人都可以看到,我做错了什么?
Thanx提前, 马库斯
您是否尝试过:'scrolledComp.setMinSize(mainContent.computeSize(SWT.DEFAULT,SWT.DEFAULT))'? – Baz
只是旁注:'GridLayout'的第一个参数是'numColumns'。不知道你为什么使用'GridData.FILL_BOTH'。 – Baz
GridData.FILL_BOTH是一个修复错误的地方,之前没有8)Thanx,让它与computeSize一起工作。你不想让这个答案? –