iOS Autolayout: constraints for three squares

2019-09-19 15:01发布

问题:

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.