D DickD Active Member Licensed User Jun 14, 2017 #1 I am trying to set up a scrollview completely in the B4i visual designer for the first time. In B4a I created these in code but never with the designer. I've added a scrollview and then a few textfields and switches to it. Although everything displays properly when I run the program the screen doesn't scroll. Is there a SIMPLE sample or tutorial somewhere? The B4i beginners guide didn't offer any complete information for doing this. I couldn't find a tutorial.
I am trying to set up a scrollview completely in the B4i visual designer for the first time. In B4a I created these in code but never with the designer. I've added a scrollview and then a few textfields and switches to it. Although everything displays properly when I run the program the screen doesn't scroll. Is there a SIMPLE sample or tutorial somewhere? The B4i beginners guide didn't offer any complete information for doing this. I couldn't find a tutorial.
tufanv Expert Licensed User Longtime User Jun 14, 2017 #2 did you set the scrollview1.contentheight to 2000 for example and tried to scroll down ? DickD said: I am trying to set up a scrollview completely in the B4i visual designer for the first time. In B4a I created these in code but never with the designer. I've added a scrollview and then a few textfields and switches to it. Although everything displays properly when I run the program the screen doesn't scroll. Is there a SIMPLE sample or tutorial somewhere? The B4i beginners guide didn't offer any complete information for doing this. I couldn't find a tutorial. Click to expand... Upvote 0
did you set the scrollview1.contentheight to 2000 for example and tried to scroll down ? DickD said: I am trying to set up a scrollview completely in the B4i visual designer for the first time. In B4a I created these in code but never with the designer. I've added a scrollview and then a few textfields and switches to it. Although everything displays properly when I run the program the screen doesn't scroll. Is there a SIMPLE sample or tutorial somewhere? The B4i beginners guide didn't offer any complete information for doing this. I couldn't find a tutorial. Click to expand...
D DickD Active Member Licensed User Jun 15, 2017 #3 tufanv said: did you set the scrollview1.contentheight to 2000 for example and tried to scroll down ? Click to expand... Yes. I did that both in the designer and in code. The thing I'm wondering about is panels. Does the scrollview have to be in a panel or vice versa? I think I might be missing something with how the individual fields are mated with the scrollview. Maybe add the fields first then overlay the view on top of it??? Maybe I'm missing a "group" command of some sort. Upvote 0
tufanv said: did you set the scrollview1.contentheight to 2000 for example and tried to scroll down ? Click to expand... Yes. I did that both in the designer and in code. The thing I'm wondering about is panels. Does the scrollview have to be in a panel or vice versa? I think I might be missing something with how the individual fields are mated with the scrollview. Maybe add the fields first then overlay the view on top of it??? Maybe I'm missing a "group" command of some sort.
klaus Expert Licensed User Longtime User Jun 15, 2017 #4 Attached you find a small project showing a scrollview and its layout defined in the Designer. You need to define one main layout with the ScrollView and another layout with the ScrollView content. Attachments ScrollViewDesigner.zip ScrollViewDesigner.zip 3.5 KB · Views: 602 Upvote 0
Attached you find a small project showing a scrollview and its layout defined in the Designer. You need to define one main layout with the ScrollView and another layout with the ScrollView content.
D DickD Active Member Licensed User Jun 15, 2017 #5 klaus said: Attached you find a small project showing a scrollview and its layout defined in the Designer. You need to define one main layout with the ScrollView and another layout with the ScrollView content. Click to expand... OK that works and I was able to modify it for my needs. But let me get this straight: 1. Create an empty layout that has nothing but a scrollview in it. 2. Create another layout that has a panel to which you can add various other items. 3. Create a variable in code of type ScrollView and another of type Panel. 4. Load the layout containing the panel as shown in the code below. Did I get this right? Are the two lines setting height and width necessary? Aren't they set in the layout files? Is any of this documented anywhere? I have read every posting on the forum and every tutorial containing the word ScrollView and the Beginner's guide from end to end and don't see this anywhere. Really guys, better documentation please. How about a User's Guide or, even better, a book as with B4A. Code: Copy Private scvTest As ScrollView Private pnlLayout As Panel .... scvTest.Panel.LoadLayout("LayoutFileName") scvTest.ContentHeight = pnlLayout.Height scvTest.ContentWidth = scvTest.Width Upvote 0
klaus said: Attached you find a small project showing a scrollview and its layout defined in the Designer. You need to define one main layout with the ScrollView and another layout with the ScrollView content. Click to expand... OK that works and I was able to modify it for my needs. But let me get this straight: 1. Create an empty layout that has nothing but a scrollview in it. 2. Create another layout that has a panel to which you can add various other items. 3. Create a variable in code of type ScrollView and another of type Panel. 4. Load the layout containing the panel as shown in the code below. Did I get this right? Are the two lines setting height and width necessary? Aren't they set in the layout files? Is any of this documented anywhere? I have read every posting on the forum and every tutorial containing the word ScrollView and the Beginner's guide from end to end and don't see this anywhere. Really guys, better documentation please. How about a User's Guide or, even better, a book as with B4A. Code: Copy Private scvTest As ScrollView Private pnlLayout As Panel .... scvTest.Panel.LoadLayout("LayoutFileName") scvTest.ContentHeight = pnlLayout.Height scvTest.ContentWidth = scvTest.Width
klaus Expert Licensed User Longtime User Jun 15, 2017 #6 1. You can have other objects on the 'main' layout not only the ScrollView. 2. Yes. That's the way I do it. 3. You need the ScrollView variable to be able to load its layout onto the internal panel. 4. Yes. Without horizontal anchors set to BOTH and AutoScale the two lines are not needed. During my tests I needed to add these two lines to get the display right, with horizontal anchors set to BOTH and AutoScale. Upvote 0
1. You can have other objects on the 'main' layout not only the ScrollView. 2. Yes. That's the way I do it. 3. You need the ScrollView variable to be able to load its layout onto the internal panel. 4. Yes. Without horizontal anchors set to BOTH and AutoScale the two lines are not needed. During my tests I needed to add these two lines to get the display right, with horizontal anchors set to BOTH and AutoScale.