解决方法
根据MuhammadAamirAli
here给出的答案,它是可能的.这是他回答的快照代码,我发现它很有用.
[self.benchmarkButton removeFromSuperview]; [self.benchmarkButton setTranslatesAutoresizingMaskIntoConstraints:YES]; [self.benchmarkButton setFrame:CGRectMake(20,self.benchmarkButton.frame.origin.y+40,260,30)]; [self.benchmarksView addSubview:self.benchmarkButton];