Pergunta

I know we can add a view to it's superView by calling addSubview method. But when does a view displayed and draw? Does it display immediately when addSubview method called? what's real happening inside addSubview method? can anybody tell me,very thanks!

Foi útil?

Solução

In regards to the drawing:

No, the subview is not instantaneously drawn when addSubview is executed. According to the authors Rob Napier and Mugunth Kumar, "iOS consolidates all drawing requests during the run loop, and draws them all at once" (iOS 5 Programming Pushing the Limits, 2012).

Outras dicas

You can cmd click on that method to see all the header file of that object. It is NOT possible to look/see what really happens inside that method or its implementation. You can refer here.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top