I cannot get rid of BrowserComponent scrollbar

9 views
Skip to first unread message

P5music

unread,
Dec 3, 2020, 4:02:52 AM12/3/20
to CodenameOne Discussions
My app has a BrowserComponent in the layout, where a long page can be displayed.
It is intended to scroll, but without scrollbars visible.
I see that the vertical scrollbar is visible instead. 
A further fact is that when I grab the scrollbars with the mouse pointer the side menu wants to appear and it is coming visible indeed (if I drag laterally it appears completely).

I put all this kind of code:

webView.setScrollVisible(false);
mainVertical.add(BorderLayout.NORTH,anotherArea);
        area.setScrollableX(false);
area.setScrollableY(false);
area.add(BorderLayout.CENTER,webView);
        mainVertical.setScrollableX(false);
mainVertical.setScrollableY(false);
        mainVertical.add(BorderLayout.CENTER,area);
      /*  UIManager.getInstance().setLookAndFeel(new DefaultLookAndFeel(UIManager.getInstance()) {
            @Override
            public void bind(Component cmp) {
                if (cmp instanceof Container) {
                    cmp.setScrollVisible(false);
                }
            }
        });*/
this.setLayout(new BorderLayout());
        this.add(BorderLayout.CENTER,mainVertical);

but even uncommenting those commented lines there is a visible scrollbar.
I cannot get rid of it.

Shai Almog

unread,
Dec 3, 2020, 11:13:57 PM12/3/20
to CodenameOne Discussions
Scrollbars are a feature of desktop UIs. In device builds you won't see scrollbars. I suggest you remove that code and don't do that.
Reply all
Reply to author
Forward
0 new messages