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 ...
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?
Sorry, but you don't give enough information!
It would be much easier for us to help you if you posted your project as a zip file.
That way, we see what exactly you have done and how, and we can test your project as you do !!!
Move the drawing in the MainForm_Resize routine.
In AppStart the dimensions of the view is not known.
Attached a modified version of your project.
What do you need the ScrollPane for, you don't set the dimensions of the InnerNode bigger than the ScrollPane view !?