A App Dude Active Member Licensed User Longtime User Dec 22, 2022 #1 I'm using a scrollview in B4A as a B4XView, then loading a new panel (created as a separate screen in the designer) into that scrollview. Works well. Now in B4i, the same code crashes when I do the same thing: Code: Copy svScn1.Top = 120dip svScn1.Left = 0dip svScn1.Width = 100%x svScn1.Height = 100%y-50dip svScn1.GetView(0).LoadLayout("Screen1Panel") The top of the crash shows this... B4X: Copy Error occurred on line: 99 (B4XMainPage) Expected: B4IPanelView, object type: UIScrollView Stack Trace: ( I found examples on this forum of how to do this if I define the svScn1 as a ScrollView, and then I can load the panel into the scrollview with svScn1.Panel.LoadLayout("Screen1Panel"). But not as a B4XView. Any idea how to do this? Thanks.
I'm using a scrollview in B4A as a B4XView, then loading a new panel (created as a separate screen in the designer) into that scrollview. Works well. Now in B4i, the same code crashes when I do the same thing: Code: Copy svScn1.Top = 120dip svScn1.Left = 0dip svScn1.Width = 100%x svScn1.Height = 100%y-50dip svScn1.GetView(0).LoadLayout("Screen1Panel") The top of the crash shows this... B4X: Copy Error occurred on line: 99 (B4XMainPage) Expected: B4IPanelView, object type: UIScrollView Stack Trace: ( I found examples on this forum of how to do this if I define the svScn1 as a ScrollView, and then I can load the panel into the scrollview with svScn1.Panel.LoadLayout("Screen1Panel"). But not as a B4XView. Any idea how to do this? Thanks.
mcqueccu Expert Licensed User Longtime User Dec 22, 2022 #2 Both B4A and B4i have scrollview. You don't need to declare it as B4XView before you can use it. And they work closely similar. You can load your layout in both platforms using this same code B4X: Copy svScn1.Panel.LoadLayout("YOur layout") Upvote 0
Both B4A and B4i have scrollview. You don't need to declare it as B4XView before you can use it. And they work closely similar. You can load your layout in both platforms using this same code B4X: Copy svScn1.Panel.LoadLayout("YOur layout")
A App Dude Active Member Licensed User Longtime User Dec 22, 2022 #3 Shouldn't there be a way to do this as a B4XView? Because changing to a Scrollview would change much of my other code. (The Android code is already done and working). Upvote 0
Shouldn't there be a way to do this as a B4XView? Because changing to a Scrollview would change much of my other code. (The Android code is already done and working).
klaus Expert Licensed User Longtime User Dec 22, 2022 #4 Try this in both platforms: B4X: Copy svScn1.ScrollViewInnerPanel.LoadLayout("Your layout") Upvote 0
A App Dude Active Member Licensed User Longtime User Dec 22, 2022 #5 klaus said: Try this in both platforms: B4X: Copy svScn1.ScrollViewInnerPanel.LoadLayout("Your layout") Click to expand... This seems to work (so far). Thanks! Upvote 0
klaus said: Try this in both platforms: B4X: Copy svScn1.ScrollViewInnerPanel.LoadLayout("Your layout") Click to expand... This seems to work (so far). Thanks!