Combining Programs

Bachrock

Member
Licensed User
Longtime User
Hi,

I have several different examples that I have combined to make up one project. Everything is working the way I would like it to but I am having issues with the layout of my screen. Part of the program I copied and paste's creates items by drawing them onto the screen using code. The other part of the screen I actually created in designer. The designer items, such as Labels and buttons are not showing up the way I created them. My guess is because of the other items that are getting drawn, they are combating each other. Here is the Create_Activity section of my program.

Any thoughts?? Please Advise .......Thanks

Sub Activity_Create(FirstTime As Boolean)

If FirstTime Then
Activity.LoadLayout("pieprzak")
End If

sv.Initialize(0)
' SV.Color=Colors.Transparent
sv.Panel.Color=Colors.Black

Table = sv.Panel
Table.Color = LineColor
Activity.AddView(sv, 5%x, 50%y, 90%x, 80%y)
sv.Height=100dip

ColumnWidth = sv.Width / NumberOfColumns
ColumnWidth_1 = ColumnWidth-ColLineWidth
SelectedRow = -1
LoadTableFromCSV(File.DirRootExternal, "Trucks.csv", True)
'SaveTableToCSV(File.DirRootExternal, "1.csv")
Log("Visual Basic".SubString2(2,6))

'CODE FROM AUTOFILL SCROLL VIEW

sv2.Initialize(Me, "sv2")
sv2.AddToParent(Activity,50, 350, 400dip, 500dip)

If FirstTime Then
Dim cities As List
cities = File.ReadList(File.DirRootExternal, "Cities.txt")
'As an optimization we store the index as a process global variable
'and only build it once.
index = sv2.SetItems(cities)
Else
sv2.SetIndex(index)
End If

If FirstTime Then
server.Initialize(5500, "server")
Log(server.GetMyWifiIP)
server.Listen


End If


End Sub
 

stevel05

Expert
Licensed User
Longtime User
Please use [ Code] [ /CODE] tags (no spaces) when posting code, it makes it easier to read.

You are adding 3 things to the activity, the layout, which I don't know the contents of. SV1, which takes up most of the screen and then SV2 which I assume also takes up a good amount of the screen.

From the code you've posted, they will all be on top of each other.

You don't say how you want things to behave, you could hide some of the views,
B4X:
sv.visible = False
sometimes, and set it visible when you want it to.

Without more information it's difficult to guide you.
 
Upvote 0
Top