Domanda

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!

È stato utile?

Soluzione

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).

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top