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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:18:19+00:00 2026-06-02T00:18:19+00:00

When I place a button at the top-left side of the window, it aligns

  • 0

When I place a button at the top-left side of the window, it aligns exactly like I would expect:

http://stuf.ro/Button.png

It also doesn’t resize along with the window, which is good. If I try to do the same thing with a custom view however, it automatically adds constraints to the bottom and to the right, which makes the view resize along with the window:

http://stuf.ro/View.png

How do I get rid of these? I’d like the view to never resize, and I’d like it to be pinned to the top-left side of the window, just like a button.

If I try to select the constraint and press the Backspace key, nothing happens. The “Delete” option in the edit menu is disabled as well.

  • 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-02T00:18:21+00:00Added an answer on June 2, 2026 at 12:18 am

    Your view resizes because it has constraints saying the space above it, below it, to its left, and to its right should be fixed. These are the lines you can see around your view in the screenshot. The only way to satisfy these constraints as the window resizes is for the view to resize.

    You can select the constraint lines to modify or delete them. You might think you could delete the ones below and to the right, and your view will no longer need to resize to satisfy the remaining constraints, but that doesn’t work. The view needs a (set of) constraints that specify both size and spacing: having the (automatically created) spacing constraints on either side implies size, but if you got rid of one of them the size would no longer be specified. (This is why you can’t get rid of automatically created constraints — the ones which appear as narrow blue lines in the view and with purple icons in the document outline.)

    This isn’t a problem for the button because buttons know how to size themselves, and IB knows about how buttons size themselves. IB doesn’t know about your custom view, so you have to set up the constraints yourself. With the view selected, choose Editor > Pin > Width to create a width constraint. This both creates a width constraint and turns the existing spacing constraints into user constraints (as opposed to automatic ones) — they appear as solid lines and have blue icons in the document outline.

    Now you can select the spacing constraint on the right and delete it, and your view will keep its width and stick to the left. Repeat for height and space below and your view will stay in the upper left and not resize.

    You can read more about the new auto layout system in Apple’s guide.

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

Sidebar

Related Questions

is it possible to place a button in TabContainer header on the left side
How do you usually create views with button in top-left corner to create something
I would like to hide a div when a button is clicked and show
I have a small button I want to add to the top left corner
We have place a button on a view. When we press it, nothing happens.
goal : I want to place a text after the submit button using hook_form_alter.
I am trying to put a JavaFX button in a specific place (specific coordinates)
In my code I have one textbox and one button. Whatever place you type
I'm trying to create a view with 2 buttons on top(1 at left hand
I have a div which I place at the top right-hand corner of a

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.