Button 在ios7中旋转,带有6个按钮的自动布局,从(2 x 3)到(3 x 2)
我试图找出如何在我的项目中使用autolayout,但没有找到任何有用的教程 下面是肖像中的样子:Button 在ios7中旋转,带有6个按钮的自动布局,从(2 x 3)到(3 x 2),button,rotation,ios7,xcode5,autolayout,Button,Rotation,Ios7,Xcode5,Autolayout,我试图找出如何在我的项目中使用autolayout,但没有找到任何有用的教程 下面是肖像中的样子: [ ------------ ------------ ] [ | Button1 | | Button2 | ] [ ------------ ------------ ] [ ] [ ------------ ------------ ] [ | Button3 | | Button4 | ] [
[ ------------ ------------ ]
[ | Button1 | | Button2 | ]
[ ------------ ------------ ]
[ ]
[ ------------ ------------ ]
[ | Button3 | | Button4 | ]
[ ------------ ------------ ]
[ ]
[ ------------ ------------ ]
[ | Button5 | | Button6 | ]
[ ------------ ------------ ]
[ ]
这里是风景:
[ ------------ ------------ ]
[ | Button1 | | Button2 | ]
[ ------------ ------------ ]
[ ]
[ ------------ ------------ ]
[ | Button3 | | Button4 | ]
[ ------------ ------------ ]
[ ]
所以我希望按钮5在旋转时向上靠近按钮2,按钮6靠近按钮4。像这样:
[ ------------ ------------ ------------ ]
[ | Button1 | | Button2 | | Button5 | ]
[ ------------ ------------ ------------ ]
[ ]
[ ------------ ------------ ------------ ]
[ | Button3 | | Button4 | | Button6 | ]
[ ------------ ------------ ------------ ]
[ ]
对于类似记事本的方案,我真的很抱歉,但我无法上传图像,这是我所能做的最好的事情您的问题不清楚您是想在情节提要还是代码中这样做。乍一看,我认为仅仅在情节提要中改变这样的布局约束关系是不可能的。但是,您确实有能力在轮换时通过编程更改这些关系。我希望故事板会有答案。这看起来更像是流布局的工作(例如UICollectionView)。以下是指南:这篇文章可能会对你有所帮助:@bilobatum:你的链接引用了一个过时的答案。iOS7仅适用于没有乘法器的Xcode 5。我同意bilobatum:我会考虑集合视图(或在代码中设置它们)