Android Tutorial TabHost tutorial

Status
Not open for further replies.

AscySoft

Active Member
Licensed User
Longtime User
Check out my TabHostExtras library.

You can set tab height and even toggle the visibility of the tabs!

Martin.

wow... I forget about this thread... just now I realise it is a option for my request... I'me still developing my app, and the tabviews look bad by far... to much space used for nothing...but.. until now
Sorry for the language, I am continously working now for the past 15 hours.. my eyes hurts , but not my pride! :icon_clap:
 

gemasoft

Member
Licensed User
Longtime User
Anyone know how to locate an object within a tabhost?

Anyone know how to locate an object within a tabhost?
 

jake

Member
Licensed User
Longtime User

I'm just getting started with tabhost, but I tried adding some code to this example to position and size p1 but Ikeep getting null pointer exceptions.

Can these panels be positioned/sized on a tab page or do they need to fully fill the page?
 

mhol99

New Member
Licensed User
Longtime User
TabHost with Buttons on the Bottom

You should be able to "Fake" a tabhost with buttons at the bottom by designing a layout made of buttons, and enabling / disabling them, and making them visible / not visible.

B4A is new to me and I used to program in PASCAL about 20 years ago, so learning curve for me is huge, but I always liked writing code that mimic'd things.
 

warwound

Expert
Licensed User
Longtime User
Yes a Tabhost with the TabIndicators at the bottom instead of the top is a great idea and far from impossible.

Stackoverflow along with the official documention has enough info to show how to do this with the native Android SDK.
(I looked into this myself a month or so back.)
I didn't get very far though as the info i found detailed the SDK XML method of creating a View and i don't know enough about the SDK to implement it entirely in code as would be required for a B4A BottomTabHost library

Martin.
 

hdtvirl

Active Member
Licensed User
Longtime User
Tab Pages

Hello All, is it possible to remove (pages/Tabs) from a TABhost at run time, I wish to change the tabs available to users based on their selection in the first Tab Page (Left hand Side). They alway return to the first tab after the operation associated with the Selected TAB is finished.


The application can have different numbers of tab pages based on their selection, some might have one and other might have 2-4.

Thanks and Regards

HDTVIRL
 

hdtvirl

Active Member
Licensed User
Longtime User
Thanks Erel for your prompt response, I had downloaded this library to take an look at it later if it was not possible to remove a tab at run time.

I had already implemented a Tabhost solution and somebody asked me if it was possible to remove some tabs as to not give the end user the option to select them.

I think the newer library offer some better design time option in appearance also.

Thanks and Regards

hdtvirl.
 

luke2012

Well-Known Member
Licensed User
Longtime User
my page = some views + tabhost. Possible ?

Hi to all!
I'm approcing the tabhost solution and I wish known if it's possible to use it embedded into a panel.
I try to explain better.
I wish to design a page (panel/activity) where on the top there are some labels, EditText and ListView.

In the bottom of the page I wish to display a tabhost.

It's possible ?

Thanks!
Have a nice day!
 

cymorg

Member
Licensed User
Longtime User
TabHost and Spinner

Using Erel's example I created a TabHost, added a Spinner to Page2 and added code to load values into the Spinner, as below
B4X:
Sub btnNext1_Click
   TabHost1.CurrentTab = 1 'move to next tab
   Spinner1.Initialize("")
   Spinner1.Add("Value1")
   Spinner1.Add("Value2")
End Sub
I tried numerous variations of this (e.g. adding the code to Activity_Create, Activity_Resume, TabHost1_TabChanged etc.) but I haven't got the Spinner to load any values. Where am I going wrong? :sign0104:

Problem solved... I didn't change any code so have no idea what was going on there, I just redeployed and hey presto. Weird.
Problem recurred... Too hasty thinking this problem went away, it didn't. The Spinner will only load values the 2nd, and subsequent, times it is accessed. I have gone through my code thoroughly and EXACTLY the same code is executed EVERY time. The system clearly interprets the same code differently depending on how many time it runs which, by my reckoning, is a BUG.
 
Last edited:

bodycode

Member
Licensed User
Longtime User
First Tabhost tutorial doesn't seem to use the panels.

I'm probably wrong, maybe you can help me out here. In the first tutorial, 3 panels are declared, but I don't see them being used anywhere in the first tutorial in the beginner's guide in your excellent "interfaces" section.

I see how everything else works with the layout files, but not the actual panel objects.

Following my own thinking, I commented out the declarations of pnlPage1 through 3, and the program still seemed to work. What the heck am I missing?

Thanks in advance.
Marsh
 

gapi

Active Member
Licensed User
Longtime User
How can load dinamically data in each layout ? On tabChange I want show user data seprated by tabhost. It's possible ?

thanks
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Tab textsize

Is there a way to set the textsize of the tab, where you write "Name", "Color", "Animal"...?
 
Status
Not open for further replies.

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…