我的问题是,如果我的滚动复合材料有
scrolledWrapper.setExpandHorizontal(true);
scrolledWrapper.setExpandVertical(true);
它在整个ViewPart上正确扩展,但如果我收缩View,则不会出现滚动条.
如果我没有设置展开,则滚动条会出现,但滚动的复合材料内的整个复合材料不会展开.
GridLayout gridLayout = new GridLayout(1, true);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
ScrolledComposite scrolledWrapper = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
scrolledWrapper.setLayout(gridLayout);
// if set the scrollbars dont appear but the composite expand on the whole view
scrolledWrapper.setExpandHorizontal(true);
scrolledWrapper.setExpandVertical(true);
scrolledWrapper.setLayoutData(gridData);
scrolledWrapper.setBackground(Display.getCurrent().getSystemColor(BG_COLOR));
有人知道如何设置Composite以扩展到我的整个视图,但是当视图缩小时还会显示滚动条吗?