TabHost example

Default TabHost example

In this example we will create one layout with a TabHost that fills the entire screen. Using a custom class which you can use in your own project we will add three tabs to the TabHost by loading additional three layout files.
The class is included in the attached zip file.

The first layout (MainLayout) consists of a single TabHost.
Using the following script the TabHost is set to fill the entire available screen:
Code:
'All variants script
TabHost1.SetLeftAndRight(0100%x)
TabHost1.SetTopAndBottom(0100%y)
We also set the NativeClass property to: .ExtendedTabHost
At runtime our class will be instantiated instead of the standard TabHost.

The ExtendedTabHost includes a helper method named extendedAddTab which is useful for adding tabs.
It expects 4 arguments:
- Tab title
- Default bitmap (for the title)
- Selected bitmap (for the title)
- The tab page view.