Tag: 视觉格式语言

Autolayout不工作和警告

我正在试图在视图底部的上方添加一个button。 我以编程方式添加自动布局约束,这里是我的代码。 – (void)viewDidLoad { [super viewDidLoad]; NSLog(@"height : %f", self.view.bounds.size.height); [self.view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=topSpace)-[button1]" options:0 metrics:@{@"topSpace":@(self.view.bounds.size.height*0.9f)} views:@{@"button1" : self.button1}]]; // Do any additional setup after loading the view, typically from a nib. } 该代码的结果显示在图像中 该button肯定不在superview的底部。 另外,当我运行我的程序时,我收到以下警告。 2014-06-01 22:02:19.144 AutoLayout[2886:60b] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following […]