开发者

Find out which segment the image resides in objective c

开发者 https://www.devze.com 2023-01-21 15:39 出处:网络
I have created a rotating wheel of 5 images. What I would like to find out is which image ends up in the top right c开发者_运维技巧orner.

I have created a rotating wheel of 5 images. What I would like to find out is which image ends up in the top right c开发者_运维技巧orner.

Is there any way I can realize which one is in the top right corner through coding?

Thanks :)


If your images are going to end up in specific spots, meaning you know exactly what will be the position of an image when it is in the 'top right corner', you can check the origin (of directly the frame) of that image view.

BOOL bingo = CGRectEqualToRect(imageViewRect, topRightCornerRect);

or

BOOL bingo = CGPointEqualToPoint(imageViewOrigin, topRightCornerRectOrigin);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号