我希望有一个 UI 可以填充物理显示器,而外部没有滚动条,并且可以调整到不同大小/纵横比的显示器。基本空间分为 2 个垂直面板。这些面板之一旨在具有固定部分和可滚动区域。
function doGet() {
var app = UiApp.createApplication();
// overall panel to fill available display
// var container = app.createSimplePanel().setSize("100%","100%");
// Contains a panel to be divided in two
var outer = app.createHorizontalPanel().setSize("100%","100%");
// Two vertical panels (equal size) filling available space within outer
var p1 = app.createVerticalPanel().setSize("100%","100%");
var p2 = app.createVerticalPanel().setSize("100%","100%");
// Left hand panel p2 holds two panels. One fixed height
var p4 = app.createVerticalPanel().setSize("100%","20PX");
var scrollPanel = app.createScrollPanel().setId('sp').setTag('Empty').setSize("100%","100%");
// The scroll panel is to hold a variable number of elements and use the space available to display the maximum
// demonstrated by a vertical panel with label widgets
var p3 = app.createVerticalPanel().setSize("100%","100%");
for (i=0;i<100;i++){
var lab4 = app.createLabel("Te"+(i+4)).setSize("100%","100%");
p3.add(lab4);
}
scrollPanel.add(p3);
// label to occupy fixed space above scrolled list
var lab1 = app.createLabel ("Testing********************************************************************************************************************************************************************1");
// label at top of right hand panel
var lab2 = app.createLabel("Testing********************************************************************************************************************************************************************2");
p2.add(lab2);
p4.add(lab1);
// scroll panel below label panel
p1.add(p4)
p1.add(scrollPanel);
// add some formatting to make panels show up
applyCSS(outer,_outerContainer)
applyCSS(p1,_innerContainer)
applyCSS(p4,_outerContainer)
applyCSS(p2,_innerContainer)
applyCSS(p3,_innerContainer)
outer.add(p1).add(p2);
// container.add(outer);
//app.add(container);
app.add(outer);
return app;
}
(1) 我应该怎么做才能让显示器分成 2 个相同大小的面板?大小显示取决于内容的相对大小。(2) 如何让垂直面板 P1 在可用物理空间内最大化滚动面板的大小?按照编码,固定块放置正确,滚动面板从包含垂直面板的中间开始。