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.
我有一个 drawInRect 方法,我希望在另一个 UIView 上使用它,这个视图的子视图。
有没有办法做到这一点?
如果您对复制绘图感兴趣,可以将绘图放在drawFunct顶层视图的单独函数 () 中,然后[self.superview drawFunct]从子视图中调用 drawInRect。
drawFunct
[self.superview drawFunct]
drawInRect
drawInRect通常不鼓励调用。