0

Instead of guessing the float points of a UI element on the screen, is there any tool to tell me the exact position of a UI element in my storyboard?

4

1 回答 1

3

我不确定你是否看过 Xcode 中的Utilities部分。它显示在右侧。如果不存在,请单击查看部分的第三个按钮

查看按钮

然后您可以找到标尺选项卡,您可以在其中查看所需的 CGRect 的所有值:X、Y、宽度和高度。

实用尺子

PS:除此之外,如果您想在模拟器中即时查看视图的 CGRect 值,您可以使用DCIntrospect,我发现它对调试非常有帮助。您可以单击视图并查看右上角的 CGRect 值。

在此处输入图像描述

于 2013-06-04T08:19:56.310 回答