1
votes

IOS apps with scrollable areas usually scroll them up when the title bar is tapped.

There is a related theme constant statusBarScrollsUpBool but either way this does not work or only in the unlikely case one manages to tap the gap between the top of the screen and the title bar.

Now I am asking myself how to make it work.

Form.getToolbar() - then what? Obviously I cannot make it a lead component and there is no button.

I'd like to intercept a tap on the title bar the right way to be able to do the scrolling as it is provided by Form.createStatusBar().


I tried that - which is almost good - but the title shrinks when tapped:

    Toolbar toolbar = getToolbar();
    Button buttonTitle = new Button(Command.create(getTitle(), null, actionListenerUp));
    buttonTitle.setUIID(toolbar.getTitleComponent().getUIID());
    toolbar.setTitleComponent(buttonTitle);
1
It will probably take forever for me to understand this UIID stuff. If I take the "Title" UIID why does it then behave different if the component is a button - shouldn't it just show the same behaviour? - Stefan Eder

1 Answers

0
votes

You can use setTitleComponent in Toolbar and stick in whatever you want including something like:

Button title = new Button("My Title", "Title");

Alternatively you can also try other options like maybe improving the code in Form or increasing the padding for the status bar to make it more touchable.