我正在测试添加自动布局约束以编程方式查看。但它隐藏了我的观点。我在写代码...
UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(50.0, 200.0, 600.0, 200.0)];
[testView setBackgroundColor:[UIColor grayColor]];
[self.view addSubview:testView];
[testView setTranslatesAutoresizingMaskIntoConstraints:NO];
NSDictionary *views = NSDictionaryOfVariableBindings(testView);
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-50-[testView(>=600)]-50-|" options:0 metrics:nil views:views]];
为什么这隐藏了我的观点?请帮我。谢谢。