iOS Autolayout:三个正方形的约束 [英] iOS Autolayout: constraints for three squares

查看:112
本文介绍了iOS Autolayout:三个正方形的约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用自动布局实现一个非常简单的方案,但是没有成功.请帮我... 我需要3个具有动态大小的正方形(例如,在iPad上,所有这些正方形都应缩放)在一个表格单元格上.

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:

谢谢

推荐答案

您可以使用大小检查器中显示的自动调整大小工具来完成此操作.

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

第一步:将视图放置在所需的任何模式中.

第2步:然后选择一个视图,然后单击尺寸检查器.

Step3:单击以选中自动调整大小工具矩形的内部箭头,然后取消选择外部箭头(预定义选择).

Step4:对剩余的方块重复相同的步骤.而已.验证下面的图像,我已经完成了.

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.

这篇关于iOS Autolayout:三个正方形的约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆