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
1
vote
1 answer

masonry example updateConstraints vs remakeConstraints

when I use masonry to layout my view i find that the behavior is quite diffrent between updateConstraints and remakeConstraints - (id)init { self.growingButton = [UIButton buttonWithType:UIButtonTypeSystem]; [self.growingButton setTitle:@"Grow Me!"…
1
vote
1 answer

When should I use weakself in a block, and why there is no retain cycle in Masonry?

UIButton *testButton = [[UIButton alloc] init]; [self.view addSubview:testButton]; testButton.backgroundColor = [UIColor redColor]; [testButton mas_makeConstraints:^(MASConstraintMaker *make) { make.width.equalTo(@100); …
Andy Darwin
  • 478
  • 5
  • 19
1
vote
1 answer

How to update and remove Constraints using Masonry?

With Auto-layouts I am adding "1" label and "1" textfield and "2" buttons on my scrollview. Here my main requirement is when I click "Add1" button then one extra textfield must be added between "textfiled1" and buttons. And when I click "Add2"…
Krish
  • 4,166
  • 11
  • 58
  • 110
1
vote
1 answer

Dynamic UITableViewCell Producing Undesired Results

I'm attempting to create a dynamically sized table view cell. I've read every SO question, website, article, and example Github project and can't get the layout I want without errors (in its current form, there are no errors, but the end result is…
Bibs
  • 995
  • 1
  • 8
  • 17
0
votes
0 answers

iOS crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

I have received some crashes via Crashlytics. It crashed 4 times in last month. I use Masonry for autolayout and add constraint in layoutSubviews. You can see the crash trace below. 0 libsystem_platform.dylib _platform_memmove + 284 1 …
Yvan
  • 551
  • 8
  • 22
0
votes
1 answer

The right way to write masonry code? in “- init” or “- layoutSubViews”

Both ways seem to work, are there any differences in performance?
Leo.J
  • 317
  • 1
  • 3
  • 10
0
votes
1 answer

OS X Masonry view animation without effect

[macOS | OS X] Masonry view animation without effect [✔️] I have looked at the Documentation [✔️] I have filled out this issue template. Issue Info Platform: os x Platform Version: 10.12.6 Masonry Version: 1.1.0 Issue Description I'm using…
0
votes
0 answers

'NSInternalInconsistencyException', reason: 'attempting to add unsupported attribute: (null)'

Im using a (lightly modified)third party package: https://github.com/adad184/MMPopupView Iv already got a view controller where a alert is presented and works as expected Iv basically made a very similar new controller and trying to display the same…
nicwhitts
  • 190
  • 1
  • 3
  • 22
0
votes
0 answers

What's the real meaning of `AmbiguousLayout` in AutoLayout

Here is my test code written with Masonry, VFL and NSLayoutConstrant methods: UIView *view1 = [UIView generateView]; UIView *view2 = [UIView generateView]; UIView *view3 = [UIView generateView]; [self.view addSubview:view1]; [self.view…
0
votes
2 answers

How to place a child view inside a scroll view with Masonry?

I want to place a view into a UIScrollView. Price* p = _entity.prices[0]; ItemPriceCell *cell = [[ItemPriceCell alloc] initWithFrame:CGRectZero]; cell.priceLabel.attributedText = [Helper stylePriceLabel:p.priceString withFont:[UIFont…
Burak
  • 5,706
  • 20
  • 70
  • 110
0
votes
1 answer

How to stack + center two text views using programatic constraints?

I'm trying to achieve a hard coded layout where two text views should be stacked on top of each other and centered in a parent UICollectionViewCell: ---------------------- | | | This is text | | Also text | | …
Zach
  • 3,909
  • 6
  • 25
  • 50
0
votes
1 answer

iOS AutoLayout with masonry, failed to set child's bottom equal to parent bottom

I have a parent view which is red on the screen, and inside it, there is a child view which is green. When trying position child to left-bottom corner, code below failed. [superView addSubview:self]; self.backgroundColor = [UIColor…
Jerry
  • 909
  • 7
  • 24
0
votes
1 answer

Resize a superview to make its size equal to the the size of its subviews

I have subclassed a UIView and created few views inside it. I want to create an instance of this view inside my view controller's view and there's another custom view which will be placed below that view. I am not sure how do I put the second view…
Anuj Rajput
  • 836
  • 9
  • 30
0
votes
1 answer

I have a UICollectionView in a custom TableViewCell but I can't auto-resize the CollectionView

I have a UICollectionView in a custom UITableViewCell, only UIImageView in the UICollectionView. I use SDWebImage to load image.What I want is after loading the image, both UICollectionView and it's contentView(UITableViewCell) update themselves'…
0
votes
1 answer

UIScrollView Autolayout Masonry subview height changed

[self.view addSubview:self.scrollView]; [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.view.mas_top).with.offset(.0); make.left.equalTo(self.view.mas_left).with.offset(0.0); …
jxdwinter
  • 2,339
  • 6
  • 36
  • 56