iOS Autolayout: constraints for three squares

2019-09-19 14:06发布

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: enter image description here

Thanks

1条回答
趁早两清
2楼-- · 2019-09-19 14:59

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. enter image description here

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

查看更多
登录 后发表回答