android - 相机的 SurfaceView 与 TextureView?

标签 android android-camera surfaceview textureview

我想在我的应用程序中加入相机功能,这将允许 View 本身的布局转换、更改其大小、预览大小并有效地处理方向更改。我应该使用 TextureView 还是 SurfaceView

决策决策..

最佳答案

根据您的上下文,我建议使用 TextureView,因为 SurfaceView 无法实现诸如转换、动画和缩放之类的操作。但请记住,TextureView 会比 SurfaceView 消耗更多内存。

关于android - 相机的 SurfaceView 与 TextureView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27225242/

相关文章:

android - 单元测试,使用 PowerMock 在 Kotlin 中使用 Context 作为变量来模拟静态方法

android - 如何在 SurfaceView 中禁用硬件加速?

android - 如何打开相机,或从 recycleriew 项目中的按钮调用 startActivityForResult

android - 如何捕获图像缩略图并将文件保存在 Android 中的自定义文件夹中

android - setRotation(90) 以纵向模式拍照在三星设备上不起作用

Android SurfaceView 滚动

Android Surface 和 ScreenResolution

java - Android ScheduledThreadPoolExecutor 立即执行延迟任务

Android Realm findAllAsync() 卡住 UI

android - ADB 无法识别我的 Galaxy Nexus - Win7