1、使用NSLayoutConstraint记得把需要加限制的控件属性 translatesAutoresizingMaskIntoConstraints置为NO 2、如果控件使用了NSLayoutConstraint,那么控件的所有位置信息都将使用NSLayoutConstraint。