I am new to codename one development. Currently i have a challenge with the default form title. I have created my custom title area but it scrolls out of view with the rest of the form. Please how do i keep it fixed to the top of the form? P.S Codename One Rocks!! Love it!!
Asked
Active
Viewed 801 times
1 Answers
1
Thanks.
Sure. Set the form to scrollable false and its layout to border layout. Place your title at the north section of the form and a container in the center of the form. Then set the container to scrollable Y true and add all your components into that container.
This is pretty easy in the GUI builder but in code you would do something like:
Form f = new Form();
f.setScrollable(false);
f.setLayout(new BorderLayout());
f.addComponent(BorderLayout.NORTH, myTitleCmp);
Container content = new Container(ideallySetALayoutHere);
content.setScrollableY(true);
f.addComponent(BorderLayout.CENTER, content);
// now add stuff to content
f.show();

Shai Almog
- 51,749
- 5
- 35
- 65
-
Thanks Shai, got it running. However, I have a different issue I'm facing now. In my App, I want to load an external URL received from a webservice call into a WebBrowser component. It works for RIM but without CSS but doesn't show for android at all. Please what is the best way to go about it? Thanks in advance. – klipse May 17 '13 at 22:23
-
I answered this in your other question. If this solves your issue you should accept the answer. – Shai Almog May 18 '13 at 07:24
-
Shai, i have another hiccup, my webbrowser component works well on simulator for but android and rim but on real devices it shows just the blank space on the container and never loads the external url for RIM whereas on android it works perfectly. Any work around this? – klipse May 19 '13 at 00:22
-
Doesn't this http://stackoverflow.com/questions/16618837/how-to-load-an-external-url-in-codename-one-webbrowser-component answer that? – Shai Almog May 19 '13 at 08:32