我知道我有布局,但是我有将achivementsChild设置为彼此的问题。我想做一些对齐或类似的东西。现在他们站在另一个下面,我想把一个放在另一个旁边。
TabItem tbtmStudent = new TabItem(tabFolder_1, SWT.NONE);
tbtmStudent.setText("Student");
ScrolledComposite scrolledComposite_1 = new ScrolledComposite(tabFolder_1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
scrolledComposite_1.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent e) {
scrolledComposite.setFocus();
}
});
tbtmStudent.setControl(scrolledComposite_1);
scrolledComposite_1.setExpandHorizontal(true);
scrolledComposite_1.setExpandVertical(true);
List<STUDENT> allSTUDENTNodes = currentData.getStudentNodes();
Composite studentChild = new Composite(scrolledComposite_1, SWT.NONE);
studentChild.setLayout(new GridLayout());
for(STUDENT studentNode: allSTUDENTNodes){
new STUDENTNode(studentChild, SWT.NONE, studentNode);
Composite achivementsChild = new Composite(scrolledComposite_1, SWT.DEFAULT);
achivementsChild.setLayout(new GridLayout());
for(Achivements achivementsNode: studentNode.getAchivements()){
new AchivementsNode(mscbcChild, SWT.NONE, achivementsNode);
}
}
scrolledComposite_1.setContent(studentChild);
scrolledComposite_1.setMinSize(studentChild.computeSize(SWT.DEFAULT, SWT.DEFAULT));
答案 0 :(得分:0)
您可以在创建 var squatImage = UIImage(named:"First.png")!
var squatImage2 = UIImage(named:"Second.png")!
var tableImages: [UIImage] = []
override func viewDidLoad() {
super.viewDidLoad()
tableImages = [squatImage,squatImage2]
// Do any additional setup after loading the view.
}
时指定所需的列数:
GridLayout
new GridLayout(numberOfColumns, columnsEqual);
是您想要的列数。
如果numberofColumns
为columnsEqual
,则所有列的宽度都相同,如果为true
,则它们的首选大小会相同。