Designer for layouts

Dario126

Member
Licensed User
Longtime User
I want to make something like options panel on ScrollView. There should be many lines (hundreds) with different items on it (label+text, or label+dropdown or label+checkbox, etc.)

How to use designer to put all items on ScrollView, and not put them via code?
 

klaus

Expert
Licensed User
Longtime User
In the Designer put a Panel, with a height higher than the screen and add all the Views onto this Panel.
To position the views below the the screen height set the Top property a negative value.
You find an example here: ScrollView example with a Panel higher than the screen

Best regards.
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
In the Designer put a Panel, with a height higher than the screen and add all the Views onto this Panel.
To position the views below the the screen height set the Top property a negative value.
You find an example here: ScrollView example with a Panel higher than the screen

Best regards.


Cool workaround!


On the other hand I'm getting little frustrated with designer or b4a in total. In attachment there are pictures of designed layout on PC, and screen shoot from android device (Xperia J) after compilation. On device I get totally wrong layout.

In designer I have one layout with panel and views on it, this is loaded to another layout with scrollview (almost full screen area). But I had similar problems with normal single layouts (unfortunately no pictures). So I loose some valuable time to search solutions for such anomalies, instead of finishing my idea ..
Clipboard01.jpg
Screenshot_2013-08-07-18-20-08.png
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
Nothing unusual (IMHO). On one layout there is panel (size 320x510) with labels and editboxes as on first picture. On another layout (mainform) there is ScrollView (size 320x420). In mainform there is only this code,

B4X:
Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("Layout_01")
  ScrollView1.Panel.LoadLayout("Layout_Panel_01")
End Sub

Nothing else, but I would expect if in designer I put all elements as on first picture, that should appear in same format on device after compilation. Unfortunately I get screen as on second picture.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The easiest way for someone to help you with this would be for you to zip and post the project to the forum.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Please recheck your designer, you have two variants for both layouts, the second of each (320x570 scale = 1) match exactly whats in your screen capture above.
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
You are right. That seams to have been the problem. I'm not sure why and when those additional layouts have appeared, because this was blank project, and I have not created addition layouts. There was some default layout, but I have pressed "match connected device" in layout designer .. maybe this created additional layout? Never mind, I should be more careful next time. Thank You for support, You have returned me a will to continue with b4a ..
 
Upvote 0
Top