Tabris-专家,
目前我想使用 CTabFolder 来关闭 CTabItems。到目前为止,Tabris 不支持 CTabFolder 是否正确?
使用以下代码...
public class TabFolderExample extends Shell {
public TabFolderExample(Display display) {
super(display, SWT.NO_TRIM);
createContents();
}
private void createContents() {
setMaximized(true);
setLayout(new FillLayout(SWT.VERTICAL));
createTabFolder();
createCTabFolder();
}
private void createTabFolder() {
final TabFolder tabFolder = new TabFolder(this, SWT.NONE);
final TabItem tab0 = new TabItem(tabFolder, SWT.NONE);
tab0.setText("Tab0");
Text text0 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text0.setText("Content Tab0");
tab0.setControl(text0);
final TabItem tab1 = new TabItem(tabFolder, SWT.NONE);
tab1.setText("Tab1");
Text text1 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text1.setText("Content Tab1");
tab1.setControl(text1);
}
private void createCTabFolder() {
final CTabFolder tabFolder = new CTabFolder(this, SWT.NONE);
final CTabItem tab0 = new CTabItem(tabFolder, SWT.NONE);
tab0.setText("Tab0");
Text text0 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text0.setText("Content Tab0");
tab0.setControl(text0);
final CTabItem tab1 = new CTabItem(tabFolder, SWT.NONE);
tab1.setText("Tab1");
Text text1 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text1.setText("Content Tab1");
tab1.setControl(text1);
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
我在 iPad 上得到了这个结果。底部的 CTabFolder 为空。
您目前建议如何解决此问题?我在考虑 StackLayout 和标签?
最好的祝福。