如何在DrawRect方法中获取UIView的位置 [英] How to get UIView's Position in DrawRect method

查看:42
本文介绍了如何在DrawRect方法中获取UIView的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个视图并且正在这些视图中绘制圆圈.用户能够移动这些视图.我如何获得每个视图的位置?

I have 4 views and i am drawing circles inside these views.The user is able to move these views.How can i get the position of each view?

推荐答案

CGPoint origin = view.origin;
CGPoint center = view.center;
CGRect frame = view.frame;

所有这些东西都可以用来获得想要的东西.

All these things can be used to get what you want.

这篇关于如何在DrawRect方法中获取UIView的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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