Settings for AutoLayout multipli properties in iOS

Source: Internet
Author: User

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




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.