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

  • Home
  • SEARCH
  • 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 8768909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:11:26+00:00 2026-06-13T17:11:26+00:00

You will notice the red + / arrows glyph in the attached screenshot. It

  • 0

You will notice the red “+” / “arrows” glyph in the attached screenshot. It is easy enough to change this “origin” point in Xcode. Is there also a way to do this programmatically or is this entirely an Xcode abstraction?

enter image description here

For instance, I want to programmatically create a UILabel and position it by calculating the lower right hand coordinate. In Xcode, I would simply make sure that the red “+” is on the bottom right grid point and define the X, Y, Width and Height parameters with that “origin” in mind.

  • 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-13T17:11:27+00:00Added an answer on June 13, 2026 at 5:11 pm

    If you’re not using autolayout, you can position a label (or any view) in code by setting its center. So if you know where you want the label’s lower right corner to be, you can just subtract half the width and height of the label to compute where its center should be:

    CGPoint lowerRight = somePoint;
    CGRect frame = label.frame;
    label.center = CGPointMake(lowerRight.x - frame.size.width / 2,
        lowerRight.y - frame.size.height / 2);
    

    I would recommend just doing that.

    But if you want, you can instead go to a lower level. Every view has a Core Animation layer, which is what actually manages the view’s on-screen appearance. The layer has an anchorPoint property, which by default is (0.5, 0.5), representing the center of the layer. You can set the anchorPoint to (1, 1) for the lower-right corner:

    label.layer.anchorPoint = CGPointMake(1, 1);
    

    Now the label’s center actually controls the location of its lower right corner, so you can set it directly:

    label.center = somePoint; // actually sets the lower right corner
    

    You’ll need to add the QuartzCore framework to your target and import <QuartzCore/QuartzCore.h> to modify the anchorPoint property.

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

Sidebar

Related Questions

There is a site at http://beta.es3inc.com and you will notice at the bottom that
I made this incredible plugin that will change the fate of the world http://jsfiddle.net/4phfC/1/
Many editors will notice when a file changes out from under them. Are there
I have a web.py project with a notice module - the system will notice
Example: http://soundcloud.com/torsmusic/emancipator-siren-tor-remix You will notice that if you click play, the favicon dynamically displays
I have the following XML code. You will notice the tag Description is repeated,
I have the following connection string, and you will notice Provider's.Tests, notice the single
I notice on bad quality websites with ads a piece of the site will
Notice while on Google's homepage, with no focus on any element, pressing BACKSPACE will
You will notice the primary query is NOT using an index on school_id, when

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.