开发者

iOS: is it allowed to paint outside the bounds

If clipToBounds = YES then you can draw all you want, but you only can paint inside the bounds. If it is set to NO then painting outside the bounds is possible, but is it allowed?

开发者_高级运维

The reason that I'm asking is because iOS uses the concept where the environment takes care of making sure the correct parts of the screen are (re)painted (e.g. setNeedsDisplay). If I draw outside my bounds, will it goof up?

I have tried it, and it seems to work, but?


Evgen is right and it is clearly documented in "View Programming Guide for iOS". You will not be able to handle events from outside of the bound though.


I don't think your app gets rejected by Apple, if that's what you mean. After all it's just making use of a public and documented API. But be prepared for strange effects as this way the correct drawing order cannot be guaranteed any more.


Yes, it's work and there is nothing wrong with using this property. Your objects will be repainted as necessary.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜