Hi all:
I'm trying to adapt this B4J sample to B4A
A simple custom view which creates a grid of panes. You can set the number of columns and rows. The panes are resized automatically when the GridManager is resized, make sure to use anchors in your layouts. In this example the same layout is loaded in each of the panes. You can of course load...
as Erel says:
It should be simple to port it to B4A. Add a new custom view class and add the code from this class (you will need to make some small and hopefully trivial changes). There is no resize event in B4A as the activity is recreated when the screen size changes.
Well I've followed the steps, replacing "Pane" with "Panel", deleting Base_Resize sub.
Not sure, but I've replaced "Base.AddNode(p, 0, 0, 0, 0)" with "Base.AddView(p, 0, 0, 0, 0)"
When I run the app, I get a blank screen, and I get:
Panel size is unknown. Layout may not be loaded correctly.
I get that warning from:
Public Sub GetPanel(Column As Int, Row As Int) As Panel
Return panels(Column, Row)
End Sub
I guess I should set the panel width and height at some point, I've been searching about this, and I've seen Klaus tip
here, but I can't figure it out how to do it.
Next step would be make the base? panel scrollable.
BTW, In the original sample, I can't see how Erel sets the panels position.
See attached a small project.
Thanks