Questions tagged [pure-layout]

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends UIView/NSView, NSArray, and NSLayoutConstraint with a comprehensive Auto Layout API that is modeled after Apple's own frameworks.

PureLayout is a cross-platform Objective-C library that works (and looks!) great in Swift. It is fully backwards-compatible with all versions of iOS and OS X that support Auto Layout.

PureLayout provides a fully capable and developer-friendly interface for Auto Layout. It is designed for clarity and simplicity, and takes inspiration from the AutoLayout UI options available in Interface Builder while delivering far more flexibility. The API is also highly efficient, as it adds only a thin layer of third party code and is engineered for maximum performance.

Source

41 questions
1
vote
0 answers

Purelayout - Center icon to dynamic two labels

I have added an arrow icon in following sample: https://github.com/smileyborg/TableViewCellWithAutoLayout [self.nextarrow autoPinEdgeToSuperviewEdge:ALEdgeTrailing withInset:kLabelHorizontalInsets]; [self.nextarrow autoAlignAxis:ALAxisHorizontal…
Tariq
  • 9,861
  • 12
  • 62
  • 103
1
vote
1 answer

Autolayout Contraints Changes in CollectionViewCell

I am using PureLayout to create the constraints in cellForItemAtIndexPath if (!_itemDetails){ _itemDetails = cell.itemDetails; _itemDetailsConstraint = [_itemDetails autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
1
vote
1 answer

Using PureLayout library pinEdge right UIView in UIScrollView not working or how-to?

I'm using PureLayout library. Github I've UIScrollView as a fullscreen container. As a simple example, I've a UIView(0,0,100,50). I want to pin this view's right edge to right edge of UIScrollView. I'm doing it this way: UIScrollView *sv =…
Almas Adilbek
  • 4,371
  • 10
  • 58
  • 97
1
vote
1 answer

image view not scrollable in scrollview and not fit properly using pure layout

I'm simply trying to place an image into scroll view which is in a main view using purelayout. And what i'm taking right now is; Note that view with red background is scroll view. And also the image is not scrollable. - (void)loadView { …
Eray Diler
  • 1,095
  • 1
  • 10
  • 17
1
vote
0 answers

iOS 8 UITableViewCell constraints break after adding accessoryType

Technically, the constraints don't break but they stop working as intended. I have forked PureLayout's iOS 8 AutoLayout example to replicate this issue. In a nutshell, I have a UITableView with a custom cell that looks like this: After…
marcus
  • 151
  • 1
  • 8
0
votes
1 answer

Swift Custom TableViewCell (Card)

I am trying to make a card-like cell (one that looks like it is floating on its own). Right now, I am just trying to get a red UIView to appear within the cell (padded by 12 pixels for the margins). Here is the code from the UITableViewCell class:…
Caleb Rudnicki
  • 345
  • 8
  • 17
0
votes
1 answer

Can't position label to right edge of view using PureLayout

I found a great tutorial that explained a good but on how to use PureLayout to do some cool and easy layout stuff. I'm having some trouble getting my label to align itself to the right of the view I'm attempting to put it in though I have this in…
Jordan
  • 2,393
  • 4
  • 30
  • 60
0
votes
1 answer

How to use PureLayout to space labels apart

I'm having some trouble getting PureLayout to work with UILabel's that I'm putting in my view and attempting to space apart from each other I have one label that is spaced with some margin from the top of the view and the left of the view. Then I…
Jordan
  • 2,393
  • 4
  • 30
  • 60
0
votes
2 answers

Where should we place our auto layout code?

I usually set all my auto layout code in the updateCOnstratins method of my view controller for the constraints of all the subclasses defining the view. Then in the subviews I place my constraints in the updateConstraints methods there. This makes…
Esko918
  • 1,397
  • 1
  • 12
  • 25
0
votes
1 answer

Using scroll view programmatically

I am trying to develop an app with the UI created only programmatically. I want to create a simple view which is a UIScrollView (to be able to scroll the view when the keyboard is appearing) with a containerView (UIView) where we can find a…
PaulM
  • 35
  • 6
0
votes
1 answer

Resize uiscrollview based on content

I'm having some problem resizing and making scrollview scrollable vertically when content is added to my labels. My hierarchy looks like this: my hierarchy While my view looks like this: my view So I would like to fill out labels with content in my…
0
votes
2 answers

Setting PureLayout constraints correctly?

Im using PureLayout for my programatic view constraints. I thought I had them setup correctly, size, X and Y addressed. However when I run my code on an SE vs a 7 Plus, the view doesn't align correctly. Here is a snippet of the code: if…
jackdm
  • 319
  • 7
  • 17
0
votes
1 answer

Swift trailing constraint not working as expected in tableview

I have UITableView extension defined with a function to place a default view on top of a tableView. For some reason the following lines of code do not work as expected. 1) Code which did not provide the right solution func addNoDataView() -> UIView…
0
votes
2 answers

Swift PureLayout: Add x points of padding above and below tallest vertically centered subview

I am using the PureLayout framework and writing my UIView in Swift. I have a view, which contains four buttons that are not all the same height. I have added constraints to equally space these buttons, and center them vertically within the view, and…
Jake T.
  • 4,308
  • 2
  • 20
  • 48
0
votes
1 answer

Aligning UILabel with NSSuperscriptAttributeName and Autolayout

I have a UITableViewCell with three labels: The right UILabel uses its attributedString property to add the subscripts and superscripts for the chemical formula. I am using PureLayout to set up all autolayout constraints and added the same…
koen
  • 5,383
  • 7
  • 50
  • 89