Sapui5 将分段按钮渲染为网格

Sapui5 将分段按钮渲染为网格,sapui5,Sapui5,OpenUI5控件sap.ui.commons.SegementedButton在一行中呈现一组按钮。如何将SegementedButton的这些按钮渲染为网格(主要是3 x 7)而不是一条线 new sap.ui.commons.SegmentedButton({ buttons: [ new sap.ui.commons.Button({id:"b1",height:"3em",width:"3%",text:"1"}), new sap.ui.commons.Button({id:"b2"

OpenUI5控件sap.ui.commons.SegementedButton在一行中呈现一组按钮。如何将SegementedButton的这些按钮渲染为网格(主要是3 x 7)而不是一条线

new sap.ui.commons.SegmentedButton({
buttons:
[
new sap.ui.commons.Button({id:"b1",height:"3em",width:"3%",text:"1"}),
new sap.ui.commons.Button({id:"b2",height:"3em",width:"3%",text:"2"}),
new sap.ui.commons.Button({id:"b3",height:"3em",width:"3%",text:"3"}),
new sap.ui.commons.Button({id:"b4",height:"3em",width:"3%",text:"4"}),
new sap.ui.commons.Button({id:"b5",height:"3em",width:"3%",text:"5"}),
new sap.ui.commons.Button({id:"b6",height:"3em",width:"3%",text:"6"}),
new sap.ui.commons.Button({id:"b7",height:"3em",width:"3%",text:"7"}),
new sap.ui.commons.Button({id:"b8",height:"3em",width:"3%",text:"8"}),
new sap.ui.commons.Button({id:"b22",height:"3em",width:"5%", text:"9"})
select:function(oEvent) {
alert("Selected button id: "+oEvent.getParameters().selectedButtonId);}
})

我猜你需要一个自定义控件,或者至少需要大量的自定义样式。为什么不使用一个更有用的控件呢?像网格一样我认为分段按钮不适合应用网格。您可以使用Tiles或sap.ui.layout.Grid定义3x7网格,只需在网格中需要的位置添加按钮?即使是矩阵布局也能处理这种网格布局。。。参见例如,这是来自SCN的交叉投递:交叉投递时,请注明。人们可能会花时间回答您的问题,而您的问题可能已经在SCN上得到了回答。另请参见:zyrex-要求能够在SegmentedButton中的任何给定时间选择单个按钮。如果我必须使用网格,我必须为这个需求编写自定义逻辑。SegmentedButton接近我的要求,只是它在一行中显示按钮,我需要它作为网格