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

  • SEARCH
  • Home
  • 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 5964933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:31:20+00:00 2026-05-22T19:31:20+00:00

I am working on an app that allows two media galleries to be loaded

  • 0

I am working on an app that allows two media galleries to be loaded into the same tab. They have separate XIB files and are loaded as such. However, once I switch views using the segmented control the UITabBar disappears.

This is how I am switching the views:

//Switch Views
- (IBAction)segmentSwitch:(id)sender
   {
   if([sender selectedSegmentIndex] == 0)
   {
      MediaViewController *vc = [[MediaViewController alloc] initWithNibName: @"MediaView" bundle:nil];
      vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController: vc animated: YES];
   }
   else if([sender selectedSegmentIndex] == 1)
   {
      MediaViewControllerTwo*v2 = [[MediaViewControllerTwo alloc] initWithNibName: @"MediaViewTwo" bundle:nil];
      v2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
      [self presentModalViewController: v2 animated: YES];
   }
}
  • 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-22T19:31:21+00:00Added an answer on May 22, 2026 at 7:31 pm

    The reason why your view disappear is that you are showing a modal view controller on top of it:

        [self presentModalViewController: v2 animated: YES];
    

    As you know a modal view controller takes the whole display space for it.

    What are you trying to accomplish with your segmented control?

    EDIT: in order to change the current view displayed in the UITabBar, you have several options. One is simply adding a subview to the current view; in your view controller do:

    [self.view addSubview: vc.view];
    [vc viewWillAppear:NO];
    [vc viewDidAppear:NO];
    

    the calls to viewWillAppear and viewDidAppear are required, the framework will not call them for you in this case.

    I assume that you segmented control is used to control a subarea of your view (i.e., your view has an upper part where the segmented control is and a lower part with some other content). In this case, I would simply try and replace the subview which lays below the segmented control. The technique is just the same.

    After reading your comment, you could replace one table with the other one. Or better, have them both added as subview (full frame), and just hide one or the other according to the segmented control selection.

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

Sidebar

Related Questions

I'm working on an app that allows tagging directly on photos via clicking (like
I am working on a Rails app that allows you to create a configuration
I’m currently working on a small web app that allows people to search for
I am working on an ASP.NET MVC web app that allows people to publish
I'm working on a web app that allows users to downloaded dynamically generated PDF
Have an app written that automatically reads out received text messages when they arrive.
I'm trying to add a feature into my app that allows the user to
OK, well I've been working on a simple app that allows users to save
I have an app that allows the user to cache data for offline use.
I have a CMS app that allows custom fields to be added. One type

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.