问题
I want to display two webbrowsers on one screen, the first show an URL and the second show a custom banner. I tried with a table layout to display two rows, and set the weight on 80% for the first and 20% for the second. But when I run the app only the first shows up, and cover 100% of the height
This is what I want:
Is this possible?
回答1:
Please check this codes it should solve
protected void beforePage(Form f) {
f.setScrollableY(false);
TableLayout.Constraint c1 = new TableLayout.Constraint();
c1.setHeightPercentage(80);
c1.setWidthPercentage(100);
TableLayout.Constraint c2 = new TableLayout.Constraint();
c2.setHeightPercentage(20);
c2.setWidthPercentage(100);
WebBrowser browser = new WebBrowser();
browser.setURL("http://www.facebook.com");
WebBrowser browser2 = new WebBrowser();
browser2.setURL("http://www.google.com");
f.setLayout(new TableLayout(2, 1));
f.addComponent(c1, browser);
f.addComponent(c2, browser2);
}
回答2:
yes its possible
- create tablelayout with column 1 and row 2
- add first webbrowser and set its height to 80 %
- and add second and set 20%
I hope it will help
来源:https://stackoverflow.com/questions/35462693/using-two-webbrowsers-on-codename-one-layout-management