iOS Autolayout: constraints for three squares

爱⌒轻易说出口 提交于 2019-12-13 09:23:46

问题


I'm trying to achieve a very simple scenario using auto layout but without success. Please help me... I need 3 squares with a dynamic size(ex: on iPad, all of them should be scaled) on a table cell.

I have spend already some hours finding a solution.... This picture showing how the view should look like:

Thanks


回答1:


You can do it with autoresizing tool which is appear in size inspector.

Step1: Place your views in which ever pattern you want.

Step2: Then select a view and click on size inspector.

Step3: Click to select inner arrows of autoresizing tools rectangle and deselect outer arrows (predefined selections).

Step4: Repeat same step for the remaining squares. Thats it. Verify below image which i have done.

Do same for by placing table view in your storyboard, verify below image for which points autoresizing settings for table view clearly.



来源:https://stackoverflow.com/questions/45422722/ios-autolayout-constraints-for-three-squares

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!