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

The Archive Base Latest Questions

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

I have a view controller and a view. I then have a UIImageView created

  • 0

I have a view controller and a view. I then have a UIImageView created through IB and position using the IB Inspector. Setting the UIImageView’s frame to x and y coordinatates to 0 results in the image being placed top left of the view, below the status bar.

If I then implement viewDidLoad method of the view controller and set UIImageView ‘s frame position using:

myimageview.frame = CGRectMake(0, 0, 50, 50);

Which are exactly the same coordinates as defined for the UIImageView in IB, the image is moved up underneath the status bar. It seems the coordiantes when set via code are realtive to the Window and not the parent View as shown IB.

Anyone know why there is a decrepancy between IB and code?


Some useful debugging info:

Note: That width and height of the Image View is in fact 35×37. The above dimensions were just to simplify the orignal question.

The frame info before setting it in code:

2011-03-15 13:15:34.249 MyAPP [98288:207] {{0, 49}, {35, 37}}

The frame info after setting it in code:

2011-03-15 13:15:34.250 MyAPP [98288:207] {{0, 0}, {35, 37}}

As defined in Interface Builder:

Interface Builder

As you can see IB says that the UIImageView X and Y coordinators are 0 ,0. While the debugging info above says that it’s actually 0, 49.

  • 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-20T19:24:36+00:00Added an answer on May 20, 2026 at 7:24 pm

    It seems that the problem I was having was due to a bug. I’ve rebuilt the UI in Interface Builder and now it works as expected.

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

Sidebar

Related Questions

I have created scroll view in my view controller and set the buttons in
I have a UIImageView property in my view controller set to assign. Every time
Lets say I have a view, myView, a view controller, myViewController, and some sort
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
When submitting one form from view, how can i also read or have controller
I have a view using a master page that contains some javascript that needs
I have a view controller managed in a UINavigationController. My view controller puts up
I have my main app view controller (File's Owner), its First Responder, View, and
i have table view and when user click on any row then he should

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.