Objective c 目标c中的隐藏约束
我希望在我的应用程序中以可编程的方式隐藏约束。我在这个应用程序中有三个按钮,我想隐藏中间的按钮。当我运行应用程序时,它显示了第一个和第三个按钮之间的一些间隙。怎么能把那个地方藏在两个按钮之间Objective c 目标c中的隐藏约束,objective-c,Objective C,我希望在我的应用程序中以可编程的方式隐藏约束。我在这个应用程序中有三个按钮,我想隐藏中间的按钮。当我运行应用程序时,它显示了第一个和第三个按钮之间的一些间隙。怎么能把那个地方藏在两个按钮之间 UIView *viewButtonsContainer; UIButton *btnFirst=[[UIButton alloc]init]; UIButton *btnSecond=[[UIButton alloc]init]; UIButton *btnThird=[[UIButton all
UIView *viewButtonsContainer;
UIButton *btnFirst=[[UIButton alloc]init];
UIButton *btnSecond=[[UIButton alloc]init];
UIButton *btnThird=[[UIButton alloc]init];
[btnFirst setFrame:CGRectMake(0, 0, viewButtonsContainer.width/2, btnFirst.height)];
[btnThird setFrame:CGRectMake(btnFirst.width, 0, viewButtonsContainer.width/2, btnThird.height)];
//这是非常简单和基本的,我希望它会有帮助你能显示一个屏幕截图吗?请提供更多关于布局/消费设置的信息。有不同的方法。方法:您可以为button1到button2和button2到button3设置具有水平间距的约束,并在button2中使用宽度约束,例如,当隐藏时,宽度约束的值为0。