You can't remove a tab currently.

To answer your second question, you can do something like this:

mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator
("one").setContent(R.id.content);


<LinearLayout
id=...@+id/content″
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
>

<TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”Hello World”
/>

<Button
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”Click Me”
/>


On Aug 10, 1:30 am, tstanly <tsai.sta...@gmail.com> wrote:
> hi all,
>
> I have two questions for setting tab widget,
>
> if I set three tab initial,
> then how can I remove one of three tab?
> because form the 
> reference,http://developer.android.com/reference/android/widget/TabHost.html#se...)
> there only have the clearalltabs() method.
>
> and the other question is
> when I want to add tab, the code is:
> eg:
> mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator
> ("one").setContent(R.id.mTextView);
>
> if now I want to add two component in a tab content
> such as TextView and Button widget,
>
> then how can I do that?
>
> thanks!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to