0
我正在測試添加自動佈局約束以編程方式查看。但它隱藏了我的觀點。我正在寫代碼...ios6中的Autolayout
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]];
爲什麼這個隱藏我的看法? 請幫幫我。謝謝。