Method One: Using the three-party framework masonry
[self.loginbtnmas_makeconstraints:^ (Masconstraintmaker *make) {
Make.width.equalTo (self.view.mas_width). Multipliedby (0.3);
Make.height.equalTo (@30);
Make.centerX.equalTo (Self.view.mas_centerX);
Make.top.equalTo (Self.view.mas_bottom). Multipliedby (0.7);
}]; Set a button at 0.7 of the view,
cannot be written as:
Make.top.equalTo (self.view.mas_height). Multipliedby (0.7); Will complain.
Method Two:
If you can do this with storyboard:
1. Drag the top of the imageview to the bottom flush with the superview.
2. Change the mutiplier,1 of align Center y to 4, which is Superview 1/4.
Quote a statement from others
You can understand this, Imageview.top = self.view.bottom*1 is: |
Self.view.bottom |
V |
------------------(1)
^ |
Imageview.top |
Imageview.top = self.view.bottom*0.25, which is multiplied by 0.25 on the above basis, is:
------------> (self.view.top)
(self.view)
------------> Self.view.bottom * 0.25
^
Imageview.top
------------> Self.view.bottom * 1