Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个应用程序,其中我有一个图像,我需要在图像中指定位置。但我只有图像的左值和上值。但是我们需要 x,y,width 和 height 值。然后如何从中找出值。所以请告诉我该怎么做。
left 和 top 值是 x - y 位置。您的图像需要覆盖视图的空间量(帧大小)是宽度和高度。例如,如果您的图像必须覆盖 iPhone 的全屏,则应将 frame 指定为:
image.frame = CGRectMake(0, 0, 320, 480);