Hi, the view which disappears from the bottom is not the full height of the tab. It has in the designer script SetTopAndBottom(80%y,100%y) which is fine when no icon in the tab heading, but when I have the icon I seem to lose screen estate - thanks for reply
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TabHost1 As TabHost
Dim AdPanel As Panel
Dim MainPanel As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Dim bmp1, bmp2 As Bitmap
bmp1 = LoadBitmap(File.DirAssets, "search.png")
bmp2 = LoadBitmap(File.DirAssets, "search_light.png")
TabHost1.AddTabWithIcon ("Search", bmp1, bmp2, "banner") 'load the layout file of each page
TabHost1.AddTab("Search", "banner")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Dim bmp1, bmp2 As Bitmap
bmp1 = LoadBitmap(File.DirAssets, "search.png")
bmp2 = LoadBitmap(File.DirAssets, "search_light.png")
AddTabWithIcon(TabHost1, "Search", bmp1, bmp2, "banner")
TabHost1.AddTab("Search", "banner")
End Sub
Sub AddTabWithIcon(th As TabHost, Title As String, bmp1 As Bitmap, bmp2 As Bitmap, LayoutFile As String) As Panel
Dim p As Panel
p.Initialize("")
Activity.AddView(p, 100%x, 0, th.Width - 20dip, th.Height - 84dip)
p.LoadLayout(LayoutFile)
p.RemoveView
th.AddTabWithIcon2(Title, bmp1, bmp2, p)
End Sub
Label1.Bottom = 100%y 'instead of the SetTopAndBottom
Hi, Erel - I attached zip using manage attachments, please let me know where File/export zip option is??? ThanksFrom my previous post:
Hi, Erel - I attached zip using manage attachments, please let me know where File/export zip option is??? Thanks
The database is missing from the zip file (you should add files with the Files tab). However I commented the database code and the TabHost looks fine. How do you reproduce the error?
Sub AddTabWithIcon(th As TabHost, Title As String, bmp1 As Bitmap, bmp2 As Bitmap, LayoutFile As String) As Panel
Dim p As Panel
p.Initialize("")
Activity.AddView(p, 100%x, 0, th.Width - 20dip, th.Height - 84dip)
p.LoadLayout(LayoutFile)
p.RemoveView
th.AddTabWithIcon2(Title, bmp1, bmp2, p)
End Sub
Now I see it
The correct code should be:
B4X:Sub AddTabWithIcon(th As TabHost, Title As String, bmp1 As Bitmap, bmp2 As Bitmap, LayoutFile As String) As Panel Dim p As Panel p.Initialize("") Activity.AddView(p, 100%x, 0, th.Width - 20dip, th.Height - 84dip) p.LoadLayout(LayoutFile) p.RemoveView th.AddTabWithIcon2(Title, bmp1, bmp2, p) End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?