像表格一样设置 GWT Mobile ListPanel 的格式

发布于 2024-12-29 09:54:28 字数 481 浏览 4 评论 0原文

我的 ui-binder 中有以下代码。

<m:ListPanel selectable="false">
  <m:ListItem>  
    <g:Label ui:field="sortLabel"></g:Label>
    <m:DropDownList ui:field="sortDropDown" />
  </m:ListItem>
  <m:ListItem>
    <g:Label ui:field="doneLabel"></g:Label>
    <m:FlipSwitch ui:field="displayDone" value="false"/>
   </m:ListItem>
</m:ListPanel>

我希望下拉列表和翻转开关处于相同的垂直对齐方式。 目前,翻转开关在右侧有点太多。

I have the following code in my ui-binder.

<m:ListPanel selectable="false">
  <m:ListItem>  
    <g:Label ui:field="sortLabel"></g:Label>
    <m:DropDownList ui:field="sortDropDown" />
  </m:ListItem>
  <m:ListItem>
    <g:Label ui:field="doneLabel"></g:Label>
    <m:FlipSwitch ui:field="displayDone" value="false"/>
   </m:ListItem>
</m:ListPanel>

I want that the dropdownlist and the flipSwitch is in the same vertical alignment.
Currently is the flipSwitch a little bit too much on the right side.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蘑菇王子 2025-01-05 09:54:28

不幸的是ListPanel本身(从PanelBase扩展)不支持对齐。这可能只是一个疏忽。他们使用了 FlowPanel,如果没有 CSS hack 来改变其结构,它就无法提供对齐。

为了使它们对齐,您可以:

  • 通过使用另一种类型的面板代替 FlowPanel _panel 来创建自己的 PanelBase确实支持对齐。 ,然后创建您自己的 ListPanel,它从新的 PanelBase 扩展而来。可能是你最好的选择。

或者

  • 使用一些 CSS 魔法,如下(但可能不完全一样)。诀窍是 FlowPanel 使用块布局样式,您需要将其设置为内联,而不是支持 vertical-align CSS 属性。这可能会产生不可预见的影响,因此您可能需要选择第一条路线。
.someStyle {
    垂直对齐:中间;
    显示:表格单元格;
}

Unfortunately ListPanel itself (which extends from PanelBase) does not support alignment. This was probably just an oversight. They used a FlowPanel which isn't capable of providing alignment without CSS hacks to change its structure.

In order to get them aligned, you could:

  • Make your own PanelBase that does support alignment by using another type of panel in place of FlowPanel _panel, then make your own ListPanel which extends from your new PanelBase. Probably your best bet.

OR

  • Use some CSS wizardry, something like (but probably not exactly) below. The trick is that FlowPanel uses a block layout style, and you need to make it something inline instead to support the vertical-align CSS property. This could have unforeseeable effects, so again you probably want the first route.
.someStyle {
    vertical-align:middle;
    display:table-cell;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文