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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:35:59+00:00 2026-05-20T08:35:59+00:00

I am trying to display a modal viewController in an iPad app using the

  • 0

I am trying to display a modal viewController in an iPad app using the UIModalPresentationFormSheet view style. I am looking to produce something similar to the Mail app’s new message UI/animation.

There are two things that are not behaving correctly:
The modal viewController that is presented always animates to y=0, i.e. to the very top of the
view and not some pixels below the status bar as it does in the mail app.

The documentation says:

UIModalPresentationFormSheet The width
and height of the presented view are
smaller than those of the screen and
the view is centered on the screen. If
the device is in a landscape
orientation and the keyboard is
visible, the position of the view is
adjusted upward so that the view
remains visible. All uncovered areas
are dimmed to prevent the user from
interacting with them.

However, in my case there is no dimming and I can still interact with the parentView below the modalViewController.

The controller that presents the modalView I do this:

AddNewItemViewController *newItemViewController = [[AddNewItemViewController alloc] initWithNibName:@"AddNewItemViewController" bundle:nil];
[self presentModalViewController:newItemViewController animated:YES];
[newItemViewController release];

In the viewController being presented I do this:

- (void)viewDidLoad {

    [nameField becomeFirstResponder];
    [self setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [self setModalPresentationStyle:UIModalPresentationFormSheet];
    [super viewDidLoad];
}

I hope someone can help me out.

Is there some other properties I need to set on the parent and modalViewController?

Is the viewDidLoad not the right place to do this setup?

Thanks in advance:)

  • 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-20T08:36:00+00:00Added an answer on May 20, 2026 at 8:36 am

    You set the transition and presentation styles when you create the modal view, before you call presentModalViewController. Remember, the view that creates the modal view ‘owns’ that object. You want the owner to set these properties because you might implement this modal view elsewhere in the app and want different transition or presentation styles. This way, you set it each time as appropriate.

        AddNewItemViewController *newItemViewController = [[AddNewItemViewController alloc] initWithNibName:@"AddNewItemViewController" bundle:nil];
        newItemViewController.modalPresentationStyle = UIModalPresentationFormSheet;
        [self presentModalViewController:newItemViewController animated:YES];
        [newItemViewController release];
    

    You’re right in calling becomeFirstResponder in viewDidLoad.

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

Sidebar

Related Questions

Hey im trying to display a modal view controller as soon as my tab
I'm trying to display a modal form using jquery ui. I've adapted an example
I am trying to display a modal view controller as a UIPresentationFormSheet. The view
I've been trying to display text using a Quartz context, but no matter what
I'm trying to display a loading icon while my iPhone app downloads a network
I am trying to display a modal Javascript dialog box in Chrome when a
I'm trying to display text in my OpenGL / JOGL app. Here is some
I have a tab bar application and when I display a modal view controller,
I have a modal view controller that I am trying to present a web
So I'm basically trying to display a book-layout in a modal box with images;

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.