![]() ![]() lockCanvas(…) + Gets a Canvas object for drawing into this surface. The methods used in the actual example are wrapped inside the SurfaceView after wrapping these two methods. It is important to note that the lockCanvas is not the lockCanvas and unlockCanvasAndPost methods that are called by the SurfaceHolder object when the SurfaceView is actually used for drawing. */ public class Surface implements Parcelable * Handle onto a raw buffer that is being managed by the screen compositor. Analyze the source codeĪnalyze the Surface, SurfaceHolder, and SurfaceView classes Surface surfaceView is generally used for complex UI and efficient image display for games, video, photography, etc., which require a separate thread for image processing. Unlike normal controls, SurfaceView can run outside the main thread and does not need to respond to user input in a timely manner, nor does it cause ANR problems. Model means model, or data model, or more simply, data, which is Surface in this case View means view, which represents the user interaction interface, which is SurfaceView in this case SurfaceHolder can obviously be understood as the Controller in MVC. The relationship between Surface, SurfaceHolder, and SurfaceView is essentially what is known as MVC, or Model-View-Controller. Combining these features, SurfaceView is generally used to implement dynamic or complex images and animations. ![]() surfaceView does not affect the main thread. The biggest difference between it and TextView and Button is that it is not on the same view layer as its view container, and its UI display can be done in a separate thread, so the drawing of SurfaceView does not affect the main thread. ![]() SurfaceView is a special kind of view in Android. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |