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 8008899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:16:53+00:00 2026-06-04T18:16:53+00:00

-(void)reviewClicked:(id)sender { ReviewViewController *newView = [[ReviewViewController alloc] init]; newView.delegate = self; UINavigationController *navCon =

  • 0
-(void)reviewClicked:(id)sender
{
    ReviewViewController *newView = [[ReviewViewController alloc] init];
    newView.delegate = self;
    UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:newView];
    [self presentModalViewController:navCon animated:YES];
}

I have a splitViewController setup, which is what is probably causing some issues. Within the detail view controller, I have a button that when clicked calls the above code.

The goal is to slide a view from the bottom of the screen upwards so the user can review their selections, and then click a button to return back to the original detail view. This code is working and you can click back and forth between the modal view and original detail view.

The problem is, after it slides up the screen, it continues sliding past where it should stop, and finally stops a good 10-15 pixels too far up. Basically, this modal view slides in so far up that a good chunk of the view goes above the top of the screen. Meanwhile, that same amount of space is “empty black space” at the bottom of the screen, just further suggesting that the view just simply moved too far up.

Complicating matters, it slides in just fine in landscape mode.

So the question is, does anyone know why this bug is occurring to make the modal view slide too far up and past the top of the screen?

-=-=-=-=-=-=-

Edit:
Sorry about that, I meant to type navCon in that spot. I fixed it above.

-=-=-=-=-=-=-

Solution:

-(void)reviewClicked:(id)sender
{
    ReviewViewController *newView = [[ReviewViewController alloc] init];
    newView.delegate = self;
    UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:newView];
    navCon.view.frame = CGRectMake(0, 0, 768, 1080);
    [self presentModalViewController:navCon animated:YES];
}

After some trial and error, I realized I had never actually set the frame of the view! A solution as simple as that…I had been running through examples that included .xib files, and since those files created the frame automatically, I totally overlooked it!

Keep in mind for anyone looking at this in the future. This frame is for portrait mode only. If you want landscape mode, just modify the frame accordingly:

navCon.view.frame = CGRectMake(0, 0, 1080, 768);
  • 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-06-04T18:16:54+00:00Added an answer on June 4, 2026 at 6:16 pm

    Although I had found a quick solution to the problem as described in the question. The fact is, there were many problems still around. Upon further inspection, I called upon the appDelegate to call these methods:

    [self.splitViewController presentModalViewController:navCon animated:YES];
    [self.splitViewController dismissModalViewControllerAnimated:YES];
    

    Basically, I had the root view class call the modal view which solved ALL of my issues. Apparently calling a modal view from within the detail view of a splitview is NOT the same as calling a modal view from the root view (which happens to be the splitViewController). I hope this helps anyone in the future. Cheers.

    -=-=-=-=-=-=-=-

    For more reference, see this post I stumbled upon:

    UISplitViewController – Pushing Modal View

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

Sidebar

Related Questions

- (void)viewDidLoad { [super viewDidLoad]; ac = [[AddContacts alloc]init]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:ac];
- (void)viewDidLoad { moveObjectTimer = [NSTimer timerWithTimeInterval:0.1 target:self selector:@selector(moveObject) userInfo:nil repeats:YES] -(void)moveObject image.center =
- (void)showMusicPlayer { [MediaPlayController releaseInstance]; MusicPlayController *musicPlayController = [[MusicPlayController alloc] init]; MusicPlayerViewController *musicPlayerViewController =
- (void)viewDidLoad { webCollectionOnScroller=[[NSMutableArray alloc] init]; scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 370, 320, 94)];
-(void)setUserFilters{ //init the user filters array userFilters = [[NSMutableArray alloc] init]; SearchCriteria *tmpSc= [[SearchCriteria
- (void)main { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Warning goes here NSRunLoop
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { NSMutableString *message=[[NSMutableString alloc]init]; // Notifies users about errors associated
- (void)viewDidUnload { self.GPSArray = nil; self.accelerometerArray = nil; self.headingArray = nil; self.managedObjectContext =
-(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *theXML = [[NSString alloc] initWithBytes: [myWebData mutableBytes] length:[myWebData length] encoding:NSUTF8StringEncoding];
-(void) readProductsFromDatabase { // Setup the database object sqlite3 *database; // Init the animals

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.