我有一个使用 GWT 开发的可用 Web 应用程序。现在它必须在平板电脑或更小的屏幕上调整大小,我想到了使用 GWT Bootstrap。但是现有的应用程序在war文件夹下只有一个project.html和project.css文件。目前没有使用 UI Binder 。有四个屏幕显示由 d3js 创建的不同图表。
我的问题是是否仍然可以使用 gwt bootstrap 来调整大小?或者仅使用 Bootstrap 并使用没有任何 UI 绑定(bind)器的 css 文件呢?
哪种方法更好?因为我很困惑,花了几个小时搜索和阅读。
最佳答案
如果您计划在您的 GWT
应用程序中与 Bootstrap 组件(即 NavBar
、Caoursel
等)进行交互,那么我会选择 gwt-bootstrap
因为您不必使用 JSNI
并且您可以获得一些类型安全性。
如果您不需要与这些组件交互,或者您在 GWT 应用程序中主要使用纯 HTML
,您也可以使用普通 bootstrap
并添加相应的类。
编辑代码示例:
UiBinder:
<b:NavPills>
<b:AnchorListItem active="true">Item 1</b:AnchorListItem>
<b:AnchorListItem>Item 2</b:AnchorListItem>
<b:AnchorListItem>Item 3</b:AnchorListItem>
<b:AnchorListItem enabled="false">Item 4</b:AnchorListItem>
<b:AnchorListItem pull="RIGHT">Pulled right</b:AnchorListItem>
</b:NavPills>
代码:
NavPills pills = new NavPills();
AnchorListItem item1 = new AnchorListItem("Item 1");
item1.setActive(true);
pills.add(item1);
pills.add(new AnchorListItem("Item 2");
pills.add(new AnchorListItem("Item 3");
...
关于java - 现有 webapp 的 GWT Bootstrap 响应式设计与屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25312838/