Questions tagged [autolayout]

Auto Layout is a constraint-based, descriptive user interface layout system for OS X and iOS.

The Auto Layout system defines layout constraints for user interface elements. Constraints represent relationships between user interface elements such as “these views line up head to tail,” or “this button should move with this split view subview.” When laying out the user interface, a constraint satisfaction system arranges the elements in a way that most closely meets the constraints. Constraints are objects and can be established in storyboards and XIBs, exposed as outlets, and created or modified in code.

11052 questions
4
votes
3 answers

Positioning views dependent on device height in iOS

I'm switching to autolayout and I'd like to position views relatively to height of device. How should I setup constraints to satisfy such condition. I have nice layout for iPhone 5 but for iPhone 6Plus I'd like to move "red" to position of "gray": …
Fishman
  • 1,737
  • 1
  • 25
  • 42
4
votes
1 answer

Trying to move UIView off screen and use autolayout

I have a UIView that I would like to animate off the screen and then bring another view into the screen. I'm using auto layout and I have a IBOutlet set up for the left and right NSLayoutConstraint. Its seem that with out a width set for the UIView…
icekomo
  • 9,328
  • 7
  • 31
  • 59
4
votes
1 answer

Avoid animation of UITableViewCell contents, when using AutoLayout and animating size of UITableView

Initially I have a UITableView which takes up only a small part of the screen, using AutoLayout constraints. The UITableViewCells are laid out nicely - they are very basic with just an orange left aligned label and a black right aligned label. Now,…
ckibsen
  • 943
  • 1
  • 7
  • 9
4
votes
1 answer

Autolayout heights proportionally but with upper limit constraint

I am trying to use Autolayout and only Interface Builder to produce the following scene with 2 views in all four iPhone devices. As the picture indicates I would like that view2 (the bottom view) be no smaller than 45points on a iPhone 4 and never…
darbid
  • 2,545
  • 23
  • 55
4
votes
1 answer

Adding padding to a UIView using AutoLayout constraints

Imagine a simple UIView like the blue full width container below. It contains a red box and a yellow box. The red and yellow boxes are inset from the container by 10px (I know it doesn't look like it in the image. Forgive my rubbish artwork). I can…
Pat Long - Munkii Yebee
  • 3,592
  • 2
  • 34
  • 68
4
votes
2 answers

Constraints on UIScrollView with paging

I have UIScrollView which covers the whole screen, and inside it I have 3 UIView objects side-by-side, managed with paging. I'd like to make the right constraints so it would fit iPhone 6 as well. It looks like this when dragging: The constraints…
Liran Revivo
  • 1,143
  • 3
  • 15
  • 20
4
votes
2 answers

UIButton is not working/Clickable in UIScrollView

I am using auto layout with UIScrollView. Main UIView Height = 1300 ContentView (within UIScrollBar) UIView = 1100 The ConetntView contains a button at the bottom. It is completely visible but when I click it, it does not work. Constraints are : 1)…
Tisha Anand
  • 309
  • 5
  • 18
4
votes
1 answer

How to Fix Disappearing Views When the Keyboard Appears in Xcode 6?

I've included a link to a video that shows what problem I'm having: https://dl.dropboxusercontent.com/u/39330138/Bug_Demo1.mov There are two View Controllers, the first is non blurred and less important. When the plus button is clicked, the app…
nanothread
  • 908
  • 3
  • 10
  • 25
4
votes
5 answers

Constraints to keep two variable-width views close together at the center of the superview

I have two views side-by-side horizontally in a container view. They are 8 points apart, but have variable widths. I want to keep the center of the two views equal to the center of the container view, so that no matter the size of the container, the…
Eugene
  • 3,417
  • 5
  • 25
  • 49
4
votes
0 answers

Prevent scrolling when appending to or updating UITableView using NSFetchedResultsController with autolayout

I have a chat application which backs a single-section UITableViewController with a core data Messages table. Based on push messages, I update the status of a message or append new messages. When a new message arrives, I'd like to scroll to the…
Joseph
  • 1,354
  • 12
  • 15
4
votes
1 answer

How do I create a keyboard accessory view with Auto Layout in Interface Builder?

I want to add a "Done" button and a segmented control to a Decimal Pad keyboard. Ideally I would like to lay out a keyboard accessory view with Auto Layout in Interface Builder. Is this even possible? Do I create a new XIB or can I do it in the…
Robert Atkins
  • 23,528
  • 15
  • 68
  • 97
4
votes
4 answers

UITableView header height will not change in storyboard

I have a Storyboard that is using a UITableViewController. I have added a UIView as the UITableView header and set the height to 200. But, for some reason, when I preview it, the header is huge! looks to be about 540 high (header is white): Here…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
4
votes
1 answer

UIScrollView Causing "Misplaced Views" AutoLayout issues

I'm running into a strange AutoLayout related issue when I use a UIScrollView (the issue does not occur without it). I have a UIScrollView that is constrained to the boundaries of a UIView (contained within a UIViewController), and within that, I am…
Mike Z
  • 77
  • 8
4
votes
3 answers

Button not appearing in landscape mode in iOS 8

I have one button, i set it's constraints to "Horizontal centre" and "Vertical centre". It is appearing in centre as expected in portrait mode. But the moment when i rotate the device to landscape mode, the button disappears and status bar also not…
Rakesh
  • 1,177
  • 1
  • 15
  • 31
4
votes
2 answers

Is there no way to constrain the baseline of a label to match the bottom edge of another view?

I have a custom meter view. And a label that shows the numeric value graphed by the meter. Using AutoLayout constraints, I want to align the baseline of the label with the bottom of the view. When I ctrl drag between the two and choose to align…
Travis Griggs
  • 21,522
  • 19
  • 91
  • 167
1 2 3
99
100