M mmanso Active Member Licensed User Longtime User Feb 8, 2019 #1 Hi all, I've been reading and watching videos about B4X approach to multi platform development and I've realized that we can develop code that tries to be multi platform (XUI) but if we use the internal designer to create layouts, we need to create the layouts in each platform we want to use (Erel shows this in his video "XUI Cross Platform Example"). To avoid having to create layouts in each platform, I'm thinking in creating the controls on the code or have some kind of layout generator. My question is, after having that, what's the correct way to add the controls in a multi platform way? It's something like: Code: Copy Dim myBtn As B4XView myBtn.Initialize("myBtn") #If B4A Activity.AddView(myBtn, 100dip, 100dip, 100dip, 100dip) #Else If B4j ???? #End If This would be the correct way to approach such a scenario? Thanks.
Hi all, I've been reading and watching videos about B4X approach to multi platform development and I've realized that we can develop code that tries to be multi platform (XUI) but if we use the internal designer to create layouts, we need to create the layouts in each platform we want to use (Erel shows this in his video "XUI Cross Platform Example"). To avoid having to create layouts in each platform, I'm thinking in creating the controls on the code or have some kind of layout generator. My question is, after having that, what's the correct way to add the controls in a multi platform way? It's something like: Code: Copy Dim myBtn As B4XView myBtn.Initialize("myBtn") #If B4A Activity.AddView(myBtn, 100dip, 100dip, 100dip, 100dip) #Else If B4j ???? #End If This would be the correct way to approach such a scenario? Thanks.
Cableguy Expert Licensed User Longtime User Feb 8, 2019 #2 Yes, you will need to initialize and place the views according to the targeted platform. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2019 #3 The correct approach is the use the visual designer whenever possible and change the views types to B4XView. It will be easier than building the layout programmatically especially if you want it to be cross platform. Upvote 0
The correct approach is the use the visual designer whenever possible and change the views types to B4XView. It will be easier than building the layout programmatically especially if you want it to be cross platform.