0
我試圖創建一個具有多個彼此相鄰的表的UI,並選擇使用水平佈局。代碼如下所示控件在sapui5中彼此相鄰放置時有空格
var mainLayout = new sap.ui.layout.HorizontalLayout({
id : "MainLayout", // sap.ui.core.ID
width: "100%",
allowWrapping : false, // boolean
visible : true, // boolean
tooltip : undefined, // sap.ui.core.TooltipBase
dependents : [], // sap.ui.core.Control, since 1.19
content :
[
/*new sap.ui.table.Table("table",{
width : "30%"
}),
new sap.ui.commons.Panel({
id : "Panel", // sap.ui.core.ID
width : "70%", // sap.ui.core.CSSSize
height : undefined, // sap.ui.core.CSSSize
enabled : true, // boolean
visible : true, // boolean
// sap.ui.commons.Button
})*/
new sap.ui.table.Table("table",{
width : "30%"
}),
new sap.ui.table.Table("table1",{
width : "30%"
}),
new sap.ui.commons.Button("button1", {
text: "Button1"
}),
new sap.ui.commons.Button("button2", {
text: "Button2"
}),
new sap.ui.commons.Button("button3", {
text: "Button3"
})
]
// sap.ui.core.Control
})
return mainLayout;
我可以看到UI之後,如圖圖像
表之後有下一個表之前,巨大的空間。我如何刪除空白區域並使它們彼此相鄰。
感謝, 威拉
設置絕對像素值的技巧。我對sapui5的佈局有一個更通用的問題。我需要建立這樣一個屏幕 Table1 - width - x height- x Table2(below table1) - width - x height -x Table3(在表1旁邊)width - x height -2x 嘗試所有組合垂直和水平的佈局。似乎不工作。 – Veeraraghavan 2014-12-28 11:30:54
我建議將答案標記爲正確,併爲佈局查詢創建一個新問題,以及爲佈局編寫的代碼,以及出錯的地方。這將有助於我們給出更準確的答案 – Qualiture 2014-12-28 11:37:46