Questions tagged [masonry-ios-osx]

Masonry is an iOS/OS X library for helping to create NSLayoutConstraints easily.

Masonry is an iOS/OS X library (https://github.com/Masonry/Masonry) for helping to create NSLayoutConstraints easily.

According to Masonry readMe:

Masonry is a light-weight layout framework which wraps AutoLayout with a nicer syntax. Masonry has its own layout DSL which provides a chainable way of describing your NSLayoutConstraints which results in layout code that is more concise and readable. Masonry supports iOS and Mac OS X.

42 questions
13
votes
4 answers

tableHeaderView on top of first cell

I'm trying to create a tableview programmatically that has a search bar in the tableHeaderView. For some reason the search bar appears on top of the first cell. I'm using Masonry to build constraints. Can someone point me to what i'm doing wrong. -…
6
votes
1 answer

Centering a view within it's superview with Masonry

I am trying to use Masonry for iOS. I have a label and a view. I want to add the label to the view and center it horizontally in the view. However the constraint I create with masonry does not work correctly. UILabel *a = [UILabel new]; a.text =…
Tiago Veloso
  • 8,513
  • 17
  • 64
  • 85
4
votes
1 answer

How to properly use size classes when building the UI programmatically (using SnapKit)?

I have decided to create my UI programmatically as oppose to storyboards to avoid merge conflict nightmares and a few other things. However, I'm running to a few problems: How would I do size classes? My viewDidLoad methods are usually very large…
Peyman
  • 3,059
  • 1
  • 33
  • 68
3
votes
2 answers

How to use iOS Masonry (Auto Layout) to position two buttons next to each other

I am updating a screen which initially had one button at the bottom. My task is to render two buttons centered at the bottom using Masonry framework which is an AutoLayout wrapper. I would like to have the two buttons centered at the bottom and side…
user1309226
  • 739
  • 1
  • 10
  • 31
3
votes
1 answer

Masonry animationWithDuration doesn't animate

I am trying to animate a UIWebView in from the bottom on top of my viewController, and I am using masonry (https://github.com/Masonry/Masonry). I initially create my webview with the size of 0 - (x,y,height and width), and I then try to animate it…
jacob
  • 541
  • 1
  • 9
  • 19
2
votes
0 answers

Using Masonry to Layout 9 points

I'm using Masonay to layout UI like this: UI requirement The size of the 9 points are the same. And the margin between 9 points are the same. My question is that how to make margin to left of first column point equal to the margin to the right of…
MyEvonne
  • 21
  • 1
2
votes
1 answer

mas_updateConstraints didn't remove constraint in Masonry

I'm using Masonry in my UITableViewCell, the cell has two subviews, one is contentLabel, the other one is imageView. While the imageView is not always present, if the cell has one image url, present it, or hide. If the imageView is hidden, I want to…
jsvisa
  • 2,987
  • 2
  • 24
  • 30
2
votes
0 answers

iOS 8.1.3 adds padding to top and bottom of UILabel

I'm using the Masonry pod to control my constrains on my UI elements in a tableView, and my view extends UITableViewCell. I have three UI elements per cell, displaying ratings and reviews of popular cruise ports. One of the elements is removed and…
Matt
  • 6,993
  • 4
  • 29
  • 50
2
votes
1 answer

Storyboard with Masonry

What's the good way of using Masonry with storyboard? Currently I am adding views in interface builder, setting random constraints generated by XCode and then I remove them from runtime in IB as well as add them in code with Masonry.
tailec
  • 630
  • 1
  • 7
  • 20
2
votes
1 answer

Autolayout / masonry center multiple views

I use Masonry to create autolayout constraints in code. This is what I have so far: Using the following code: - (void)viewDidLoad { [super viewDidLoad]; [self.view setBackgroundColor:[UIColor whiteColor]]; UIView *container =…
Jaap van Hengstum
  • 4,494
  • 4
  • 30
  • 34
1
vote
1 answer

Setting masonry x/y constraints as a percentage of the views width/height

I am attempting to set my views top constraint (y-value) as a percentage (multiplier) of the superview's height. I need to use a reference rather than value constraint to account for the devices rotation. The equivalent of what I am trying in non…
elismm
  • 237
  • 3
  • 12
1
vote
1 answer

use masonry in swift and objectiveC mix project

I have a objective-C and Swift mix project. I m using Masonry library for autolayout. I m able to use masonry in Objective C code but not in swift. How to do that ?
Aashish
  • 209
  • 2
  • 10
1
vote
0 answers

Masonry v1.1.0 crash when using safeAreaLayoutGuide

this crash: make.top.left.right.equalTo(self.view.mas_safeAreaLayoutGuide); but this…
Jerny
  • 151
  • 1
  • 8
1
vote
1 answer

iOS, the height of scrollView content size is equal to the content view's height, but it can still scroll vertically?

[_contentView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(_scrollTabs); make.height.mas_equalTo(_scrollTabs); }]; [_scrollTabs mas_makeConstraints:^(MASConstraintMaker *make) { …
Jiang Yong
  • 11
  • 2
1
vote
0 answers

Two UILabels dynamic width in a row autolayout with Masonry

I have two UILabels side by side in a row.Left label autolayout with its text and right label's width base on left label. Code will be shown below. UIView *preView; NSArray *titleArray = @[@"abc",@"abcd",@"abcde",@"abcdefg"]; for (int i = 0; i <…
Yan
  • 33
  • 6
1
2 3