为什么这样子写,只显示一个view,另外一个显示不出来
UIStackView *stackView = [[UIStackView alloc] initWithFrame:CGRectMake(50, 50, 200, 50)]; stackView.axis = UILayoutConstraintAxisHorizontal;//设置水平方向 [self.view addSubview:stackView]; UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; view1.backgroundColor = [UIColor redColor]; [stackView addArrangedSubview:view1]; UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 150, 50)]; view2.backgroundColor = [UIColor blueColor]; [stackView addArrangedSubview:view2];