When is it necessary, or better to use a SurfaceView instead of a View ?
When is it necessary, or better to use a SurfaceView instead of a View ?
Here is an answer to the Android interview question "When is it necessary, or better to use a SurfaceView instead of a View?":
It is better to use a SurfaceView instead of a regular View in the following situations:
If your Android app needs to render complex graphics, animations, or games that require a high frame rate, SurfaceView is a better choice than View. SurfaceView provides its own drawing surface that is independent of the View hierarchy, allowing you to update the graphics without waiting for the next UI redraw.
When working with real-time video or camera preview, SurfaceView is the preferred option. It allows you to display the video or camera preview without impacting the performance of the main UI thread.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.