[英]GWT ScrollPanel with Horizontal SimplePanel
I'm trying to implement a scrollPanel within a Horizontal Panel. 我正在尝试在水平面板内实现scrollPanel。
I read this post GWT Horizontal panel with horizontal scrolling 我读了这篇文章GWT水平面板与水平滚动
The answer seems great, however I'm wondering if ravi wrapped his simple panel with a scroll Panel or vice versa. 答案似乎很棒,但是我想知道ravi是否用滚动面板包裹了他的简单面板,反之亦然。
Basically I wanted to know how the panels were nested within each other? 基本上,我想知道面板如何相互嵌套?
A scroll panel is nothing special - it's just a DIV element with some CSS set on it. 滚动面板没什么特别的-它只是一个DIV元素,上面设置了一些CSS。 That's what the answer to the other question means, as a SimplePanel
is simply a Widget that appears as a DIV. 这就是对另一个问题的答案的含义,因为SimplePanel
只是一个显示为DIV的小部件。
So what the other answer did was create a scrolling widget by: 因此,另一个答案是通过以下方式创建滚动小部件:
SimplePanel
as the content container 创建一个SimplePanel
作为内容容器 overflow-x
attribute to the SimplePanel
将带有overflow-x
属性的一些CSS设置为SimplePanel
If you prefer a more direct way of doing this check out UiBinder . 如果您喜欢更直接的方法,请查看UiBinder 。 Using it you can combine widgets/CSS/HTML elements in a form closer to how the browser renders your UI. 使用它,您可以将窗口小部件/ CSS / HTML元素组合成一种更接近浏览器呈现UI的形式。 So for example you can create a DIV with the required CSS to achive a scrolling container. 因此,例如,您可以使用所需的CSS创建DIV以实现滚动容器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.