Pārlūkot izejas kodu

Update example to show more features

I had been using masonry for a couple of months before I realised that I could just do top.left etc. An example in the readme would have exposed me to this awesomeness earlier!
Ryan Maxwell 11 gadi atpakaļ
vecāks
revīzija
43492c88c1
1 mainītis faili ar 3 papildinājumiem un 6 dzēšanām
  1. 3 6
      README.md

+ 3 - 6
README.md

@@ -277,15 +277,12 @@ Alternatively if you are only updating the constant value of the constraint you
 ```obj-c
 - (void)changeButtonPosition {
     [self.button mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.width.equalTo(@(self.buttonSize.width));
-        make.height.equalTo(@(self.buttonSize.height));
+        make.size.equalTo(self.buttonSize);
         
         if (topLeft) {
-        	make.top.equalTo(@10);
-        	make.left.equalTo(@10);
+        	make.top.and.left.offset(10);
         } else {
-        	make.bottom.equalTo(self.view.mas_bottom).with.offset(-10);
-        	make.right.equalTo(self.view.mas_right).with.offset(-10);
+        	make.bottom.and.right.offset(-10);
         }
     }];
 }