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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:06:18+00:00 2026-06-15T03:06:18+00:00

For a synch screen I made a ModalViewController on ios5. I used this code:

  • 0

For a synch screen I made a ModalViewController on ios5. I used this code:

    synchViewController = [[SynchViewController alloc] initWithNibName:@"SynchViewController" bundle:nil];
    synchViewController.modalPresentationStyle = UIModalPresentationFormSheet;

    [self presentModalViewController:synchViewController animated:YES];

    synchViewController.view.superview.frame = CGRectMake(0,0,SYNCHVIEW_WIDTH,SYNCHVIEW_HEIGHT);

    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGPoint center = CGPointMake(CGRectGetMidX(screenBounds), CGRectGetMidY(screenBounds));
    synchViewController.view.superview.center = CGPointMake(center.y, center.x);

The controller was designed in the xib file. This code worked.

Now under ios6 the presentModalViewController is depreciated. I changed the method, but now the modal view controller is totally displaced and got a wrong size.

How can I just have something like the iMessage login screen with the size of my designed xib layout?

EDIT:
It works with this code:
synchViewController = [[SynchViewController alloc] initWithNibName:@”SynchViewController” bundle:nil];

    synchViewController.modalPresentationStyle = UIModalPresentationFormSheet;
    synchViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentViewController:synchViewController animated:YES completion:nil];
    synchViewController.view.superview.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
    synchViewController.view.superview.frame = CGRectMake(0,0,
                                                     SYNCHVIEW_WIDTH,// Width
                                                     SYNCHVIEW_HEIGHT// Height
                                                     );


    synchViewController.view.superview.bounds = CGRectMake(0, 0, SYNCHVIEW_WIDTH, SYNCHVIEW_HEIGHT);
    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGPoint center = CGPointMake(CGRectGetMidX(screenBounds), CGRectGetMidY(screenBounds));
    synchViewController.view.superview.center = CGPointMake(center.y, center.x);

But only if I set animated to YES. When im trying to load it without an animation, its totally displaced again, why?

  • 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-15T03:06:20+00:00Added an answer on June 15, 2026 at 3:06 am

    What are you trying to achieve by the following code?

    synchViewController.view.superview.frame = CGRectMake(0,0,SYNCHVIEW_WIDTH,SYNCHVIEW_HEIGHT);
    ...
    synchViewController.view.superview.center = CGPointMake(center.y, center.x);
    

    The size and position of a modal (presented) controller is defined by modalPresentationStyle and trying to change it will never work reliably.

    If you want a different size of a presented controller, you have to write the controller by yourself (as a child view controller), insert it into the view hierarchy and block user interaction on the presenting controller.

    However, I strongly advise to just use a native modal controller with the default size.

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

Sidebar

Related Questions

I made a script to slide an image across the screen (in and out)
What I need is to have a simple screen in this Mac app that
I am developing an app where a synch with the backend should not block
I would appreciate some help with the following issue - you can see this
I have 2 videos: HEADSHOT.MOV and SCREEN.MOV. They are both large files and I
For some art thing there will be a video screen showing animated typography of
I've implemented a simple WPF splash screen window which informs the user about the
Simply stated, I am trying to make a game I am working on full-screen.
I'm processing large files after they are selected by the user. My code looks
My app was working great and then client asked to put a login screen

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.