I have done several projects with B4A. Now I am trying out B4J but I always have trouble getting started, partly because I don't usually use Layouts and I am trying to use them with B4J. This time I want to fill MainForm with a scrollable canvas. Here is my code ...
This is the result ...
.
The canvas does not fill the scrollpane. In the Layout Designer the parent of the canvas is "Main", which is not what I want. But I can see another problem ahead when I want to extend the canvas beyond the scrollpane boundary. How should I be doing this?
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("main") ' Loads a scrollpane
scrMain.LoadLayout("canvas", -1, -1) ' Loads a canvas anchored to parent's extents
' Do something to see if this worked ...
Dim p As Paint = fx.Colors.Green
cvs.DrawCircle(200, 200, 200, p, True, 0)
MainForm.Show
End Sub
This is the result ...
.
The canvas does not fill the scrollpane. In the Layout Designer the parent of the canvas is "Main", which is not what I want. But I can see another problem ahead when I want to extend the canvas beyond the scrollpane boundary. How should I be doing this?