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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:31:10+00:00 2026-06-18T11:31:10+00:00

Given: a ‘logo’ ( uiimageview with vertical space >= 10 from top of super

  • 0

Given:

a ‘logo’ ( uiimageview with vertical space >= 10 from top of super view) and a ‘log in’ and vertical spaces between logo and holder view is <=31

Goal:

in the lanscape mode, logo will move up to the top due to a change from screen’size and holder view should be moving regarding as well.

However, when I rotate from portrait to lanscape, what I am getting is that the vertical constraint still stays at 81 ( somehow i can not delete this value from xcode ). Moreover, the vertical space between a ‘Main View’ and ‘Log in’ can not be deleted as well. I know I am doing something wrong here.

Please help if you have any suggestions about this problem.

Details:

+picture 1 is the portrait mode with some details about the constraints

enter image description here

+picture 2 is the lanscape mode with some errors for it.

enter image description here

Edited : Like the way I set up I want the vertical space of logo can be shrinked but it is always >= 10 from the top of the main view

  • 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-18T11:31:11+00:00Added an answer on June 18, 2026 at 11:31 am

    I don’t know if this can be done all in IB — if so, I haven’t figured it out yet. I’ve done it in code as I show below. I start with a constraint from the top of the image view to the top of the main view with a fixed value and also constraints between the image view and the login view. This should be enough to satisfy the system, and you can remove any other constraints to the top or bottom of the main view (I used buttons in my test which have an intrinsic height, so I didn’t need to set that. If your views don’t have an intrinsic or specific height set, you would have to do that also). Then, in code I remove that constraint to the top (IBOutlet conTop), and remake it to the bottom:

    @implementation ViewController {
        IBOutlet NSLayoutConstraint *conTop;
        IBOutlet UIButton *button;
    }
    
    - (void)viewDidAppear:(BOOL)animated  {
        [super viewDidAppear:animated];
        [self.view removeConstraint:conTop];
        conTop = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeTop relatedBy:0 toItem:self.view attribute:NSLayoutAttributeBottom multiplier:.5 constant:-120];
        [self.view addConstraint:conTop];
        [self.view layoutSubviews];
    }
    

    By using a multiplier and a constant together, you can adjust how it moves after a rotation. The numbers I chose here looked pretty good to me, but you can mess with them to see what they do. You can think of the multiplier as a sensitivity factor — the smaller that fraction, the less change in the distance from the top you will get on rotation. If you need exact values, you can use a little algebra to calculate the values for the multiplier and constant.

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

Sidebar

Related Questions

given the controller function ctl($scope, $http) { $scope.postForm = function() { console.log(submitting form) }
Given a java class with two methods (taken from mockito): OngoingStubbing<T> thenReturn(T value); OngoingStubbing<T>
Given a string in between quotations, as such Hello The following regular expression will
given the following (sample) handlers (taken from here ): handlers = [ (r/, MainHandler),
Given a linked list such that each node is a digit from a number.
Given that an ABRecordID can change between cloud syncs and under other circumstances out
Given that the web application doesn't have su privileges, I'd like to execute a
Given this method to work on a HTML page in a webbrowser: bool semaphoreForDocCompletedEvent;
Given an NSMutableArray of dynamic CGPoint s, what is the fastest and most efficient
Given a certain date, I want to set the value of a cell with

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.