SurfaceView样本code [英] SurfaceView sample code

查看:119
本文介绍了SurfaceView样本code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用它了android SurfaceView ,或样品code可以共享一个样本教程。该API演示是我很难理解。有没有人有办法吗?

I need a sample tutorial for the android SurfaceView, or sample code using it that can be shared. The API demos are difficult for me to understand. Does anyone have alternatives?

推荐答案

<一个href=\"https://github.com/johnnylambada/WorldMap/commit/7b94ac1b9a1e1144e173b62e6f0805ee81e2e030\">This提交我世界地图的演示应用的显示你有必要的修改,以从的android.view.View 来的<一个href=\"http://developer.android.com/reference/android/view/SurfaceView.html\">android.view.SurfaceView与<一个href=\"http://developer.android.com/reference/android/view/SurfaceHolder.Callback.html\">android.view.SurfaceHolder.Callback.

This commit of my WorldMap demo app shows you the changes necessary to convert from an android.view.View to an android.view.SurfaceView with an android.view.SurfaceHolder.Callback.

它通过使用查看欺骗一点的 的onDraw() SurfaceView DrawThread ,并通过调用查看 > onSizeChanged()从内部 SurfaceView surfaceChanged 。它只是使差异较小,更容易理解。

It cheats a bit by using the View's onDraw() from within the SurfaceView's DrawThread and by calling the View's onSizeChanged() from within the SurfaceView's surfaceChanged. It just makes the diff smaller and easier to understand.

这篇关于SurfaceView样本code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆