像表格一样设置 GWT Mobile ListPanel 的格式
我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是
ListPanel
本身(从PanelBase
扩展)不支持对齐。这可能只是一个疏忽。他们使用了FlowPanel
,如果没有 CSS hack 来改变其结构,它就无法提供对齐。为了使它们对齐,您可以:
FlowPanel _panel
来创建自己的PanelBase
,确实支持对齐。 ,然后创建您自己的ListPanel
,它从新的PanelBase
扩展而来。可能是你最好的选择。或者
FlowPanel
使用块布局样式,您需要将其设置为内联,而不是支持vertical-align
CSS 属性。这可能会产生不可预见的影响,因此您可能需要选择第一条路线。Unfortunately
ListPanel
itself (which extends fromPanelBase
) does not support alignment. This was probably just an oversight. They used aFlowPanel
which isn't capable of providing alignment without CSS hacks to change its structure.In order to get them aligned, you could:
PanelBase
that does support alignment by using another type of panel in place ofFlowPanel _panel
, then make your ownListPanel
which extends from your newPanelBase
. Probably your best bet.OR
FlowPanel
uses a block layout style, and you need to make it something inline instead to support thevertical-align
CSS property. This could have unforeseeable effects, so again you probably want the first route.