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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:54:28+00:00 2026-05-13T13:54:28+00:00

A simple iphone program generated by project template View-based Application, with several buttons, and

  • 0

A simple iphone program generated by project template View-based Application, with several buttons, and I added following code:

- (void) showInfo: (UIView *) view {
    NSLog(@"view bounds  %6.2f %6.2f %6.2f %6.2f", view.bounds.origin.x, view.bounds.origin.y, view.bounds.size.width, view.bounds.size.height);
    NSLog(@"view frame   %6.2f %6.2f %6.2f %6.2f", view.frame.origin.x, view.frame.origin.y, view.frame.size.width, view.frame.size.height);
    NSLog(@"view center  %6.2f %6.2f", view.center.x, view.center.y);
}

- (BOOL)shouldAutorotateToInterfaceOrientation: UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (void)willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval) duration {
    switch(toInterfaceOrientation) {
        case UIInterfaceOrientationPortrait:
            [self showInfo: self.view];
            break;
        case UIInterfaceOrientationLandscapeLeft:
            [self showInfo: self.view];
            break;
        case UIInterfaceOrientationLandscapeRight:
            [self showInfo: self.view];
            break;
    }
}

- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation {
    switch(fromInterfaceOrientation) {
        case UIInterfaceOrientationPortrait:
            [self showInfo: self.view];
            break;
        case UIInterfaceOrientationLandscapeLeft:
            [self showInfo: self.view];
            break;
        case UIInterfaceOrientationLandscapeRight:
            [self showInfo: self.view];
            break;
    }
}

Launch simulator in Portrait, change to landscape right. I can get:

view bounds 0.00 0.00 320.00 460.00
view frame 0.00 20.00 320.00 460.00
view center 160.00 250.00
In portrait, view’s size is 320×460, and it’s origin is (0,20) because of status bar.

view bounds 0.00 0.00 480.00 300.00
view frame 0.00 0.00 300.00 480.00
view center 150.00 240.00
In landscape right, bounds’ size is changed to 480×300, However, the origin of the frame is (0, 0). And the size of frame is different from bounds.

In my head, I imagine that these coordinates are like following pictures:

Portrait

Portrait

My question is: in landscape right, it seems that the frame’s origin points to one location while bounds’ origin points to a different one. So I think somewhere in a view controller some rotation happens. Where is it and what does it do?

Thanks for reading this long and not-so-clear question. 🙂

  • 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-13T13:54:29+00:00Added an answer on May 13, 2026 at 1:54 pm

    In landscape mode, the “content view” (controller.view) will be resized and applied a transform of 90 degrees.

    Since bounds represent the bounding rectangle in the internal coordinates system, the bounds.origin will always at the upper-left corner of the view itself.

    However, frame is the bounding rectangle in the external, or parent, coordinates system. The parent of your view is the window, which still has the origin in the device’s absolute upper-left corner. Hence your frame.origin is at that position in landscape mode.

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

Sidebar

Ask A Question

Stats

  • Questions 345k
  • Answers 345k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may get NS_BINDING_ABORTED when a load is interrupted by… May 14, 2026 at 5:57 am
  • Editorial Team
    Editorial Team added an answer You can use end notation to indicate the last element.… May 14, 2026 at 5:57 am
  • Editorial Team
    Editorial Team added an answer Easiest way to fix this (but kind of a shotgun… May 14, 2026 at 5:57 am

Related Questions

I want to create an extremely simple iPhone program that will open a telnet
I want to write a simple program which can customize iphone icons like their
I'm new to iPhone programming, and I'm trying to make a simple program without
I'm working on a simple proof-of-concept for an iPhone app (and important bit of
Ok...... I'm implementing a simple OpenGL ES application on the iPhone and I recently

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.