Table in Tabhost (Noob)

stu14t

Active Member
Licensed User
Longtime User
I know I'm doing something wrong and it's probably the order of my code.

I have a TabHost with 4 layouts and on the forth tab "Input" I'm trying to put a table within a Panel "PanelTab" but it doesn't show at runtime.

Here is my code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   
   Activity.LoadLayout("main")
   Dim bmp1, bmp2, bmp3, bmp4, bmp5, bmp6 As Bitmap
   bmp1 = LoadBitmap(File.DirAssets, "info_black.png")
   bmp2 = LoadBitmap(File.DirAssets, "length_measure.png")
   bmp3 = LoadBitmap(File.DirAssets, "3_disc.png")
   bmp4 = LoadBitmap(File.DirAssets, "input_keyboard.png")
   'bmp5 = LoadBitmap(File.DirAssets, "chart.png")
   

   TabHost1.AddTabWithIcon ("Details", bmp1, bmp1, "details") 'load the layout file of each page
   TabHost1.AddTabWithIcon ("Extension", bmp2,bmp2,"exttarget")
   TabHost1.AddTabWithIcon ("Save", bmp3,bmp3, "Save")
   TabHost1.AddTabWithIcon ("Input", bmp4,bmp4, "Input") 
   
   PanelTab.Initialize("")
   Table1.Initialize (Me,"Table1",3)
   Table1.AddToActivity(PanelTab, 160dip, 30dip, 150dip, 380dip)   
   Table1.SetHeader(Array As String("Blows", "Totblows", "Pen"))
   Table1.SetColumnsWidths (Array As Int (50dip,50dip,50dip))

Thanks for the help :sign0104:
 

stu14t

Active Member
Licensed User
Longtime User
Erel,

I've added PanelTab to "Input" view using the designer. I take it that is incorrect?

Stu.
 
Upvote 0

stu14t

Active Member
Licensed User
Longtime User
Sorted :icon_clap:

Thanks Klaus / Erel

The other thing I noticed, and this is my fault, I'd placed the correct sized panel within the view at the correct location but put the Table like this:

B4X:
Table1.AddToActivity(PanelTab, 160dip, 30dip, 150dip, 380dip)

Instead of like this:

B4X:
Table1.AddToActivity(PanelTab, 0dip, 0dip, 150dip, 380dip)  ]

So placing the grid completely outside the visible portion of the panel :BangHead:
 
Upvote 0
Top