SmartGWT:水平居中 HTMLFlow
我得到了一个占据屏幕 100% 宽度的 VLayout。
它包含一些 HTMLFlow 元素,它们都居中。有一个 Flow 与屏幕宽度相同,我想将其“拆分”为 2,
例如从
"Time remaining: 01:01:01"
到
"Time remaining:
01:01:01"
所以,我尝试将流宽度设置为 50%,这可以完美控制我的 HTMLFlow 长度,但随后对齐移动到左侧,
"Time remaining:
01:01:01"
然后我尝试将其包含在 HLayout 中,以便它保持居中,但宽度被覆盖并且是不是 50% 宽度,而是更少。
"Time
remaining:
01:01:01"
我如何做到这一点?
I got an VLayout which occupies 100% of width on the screen.
It contains some HTMLFlow elements, they all are centered. There is one Flow that has the same width as the screen and I want to "split" it in 2
e.g. from
"Time remaining: 01:01:01"
to
"Time remaining:
01:01:01"
So, I tried setting the flow width to 50%, which controls my HTMLFlow length perfectly, but then the align moves to the left,
"Time remaining:
01:01:01"
then I tried to include it inside an HLayout so it remains centered but the width gets override and is not 50% width but less.
"Time
remaining:
01:01:01"
How I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能只将
添加到 HTML 字符串吗? SmartGWT 的 HTMLFlow 本身无法控制换行。来自 HTMLFlow 的 JavaDoc:
使用 HTMLFlow 组件显示 HTML 内容,该内容应扩展至其自然大小而无需滚动。 [..] 注意:由于 HTMLFlow 组件的大小由其 HTML 内容决定,因此如果给定不同大小的内容,该组件将以不同的大小绘制。
Can't you just add
<br />
s to the HTML-string. There is no way to control linewrapping in SmartGWT's HTMLFlow itself.From HTMLFlow's JavaDoc:
Use the HTMLFlow component to display HTML content that should expand to its natural size without scrolling. [..] NOTE: Since the size of an HTMLFlow component is determined by its HTML contents, this component will draw at varying sizes if given content of varying size.