Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:57:41+00:00 2026-05-25T21:57:41+00:00

After implementing the Tabs Widget Sample I tried to play with it and add

  • 0

After implementing the Tabs Widget Sample I tried to play with it and add the third tab only after changing to the second tab

protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource  
        SetContentView(Resource.Layout.Main);

        TabHost.TabSpec spec;

        spec = TabHost.NewTabSpec("tab_test1").SetIndicator("TAB 1").SetContent(Resource.Id.textview1);
        TabHost.AddTab(spec);

        spec = TabHost.NewTabSpec("tab_test2").SetIndicator("TAB 2").SetContent(Resource.Id.textview2);
        TabHost.AddTab(spec);

        //spec = TabHost.NewTabSpec("tab_test3").SetIndicator("TAB 3").SetContent(Resource.Id.widget0);
        //TabHost.AddTab(spec);

        TabHost.TabChanged += new EventHandler<Android.Widget.TabHost.TabChangeEventArgs>(TabHost_TabChanged);

        TabHost.CurrentTab = 0;
    }

    void TabHost_TabChanged(object sender, TabHost.TabChangeEventArgs e)
    {
        if (TabHost.TabWidget.TabCount < 3)
        {
            TabHost.TabSpec spec;

            spec = TabHost.NewTabSpec("tab_test3").SetIndicator("TAB 3").SetContent(Resource.Id.widget0);
            TabHost.AddTab(spec);
        }
    }

The problem is that I see the 3rd view overlay-ed on the first view before clicking the tabs, even though the 3rd tab appears only after clicking the 2nd tab. What’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:57:41+00:00Added an answer on May 25, 2026 at 9:57 pm

    I’m guessing it’s because the Third tab doesn’t have tab to go to (since we don’t create a TabSpec) so it just displays it directly on the screen.

    You could set the content you want to display when the third tab is visible to invisible shown in the example below;

    <TextView 
        android:visibility="invisible"
        android:id="@+id/textview3"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:text="this is a third tab" />
    

    and then when the tab is displayed, the text view is made visible again.

    Hope this helps,

    ChrisNTR

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After implementing matrix multiplication with CUDA. I tried to implement it with CUBLAS(thanks to
After implementing most of the common and needed functions for my Graph implementation, I
We have a strange problem when implementing sessions with ColdFusion in IE6. After login
I'm having trouble understanding the instructions of implementing Fannkuch. Instructions: http://www.haskell.org/haskellwiki/Shootout/Fannkuch After step Count
After implementing some of the solutions in my previous question , I've come up
I keep running into a pretty frustrating error in Xcode after implementing a date
Is PMBOK more for after implementing software is built, delivering it to the customer
I just started working with OpenGL, but I ran into a problem after implementing
After reading the MSDN article ( http://msdn.microsoft.com/en-us/magazine/2009.01.genevests.aspx ) on implementing a Custom STS using
After implementing Pacman and Snake I'm implementing the next very very classic game: Pong.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.