Camera.EnableShutterSound(Boolean) 方法

定义

注意

deprecated

拍摄照片时启用或禁用默认快门声音。

[Android.Runtime.Register("enableShutterSound", "(Z)Z", "")]
[System.Obsolete("deprecated")]
public bool EnableShutterSound (bool enabled);
[<Android.Runtime.Register("enableShutterSound", "(Z)Z", "")>]
[<System.Obsolete("deprecated")>]
member this.EnableShutterSound : bool -> bool

参数

enabled
Boolean

调用相机时是否应播放系统快门声音 #takePicture takePicture

返回

true 如果成功更改了快门声音状态, false 如果无法更改快门声音状态, true 如果快门声音播放已设置为请求的状态,也会返回。

属性

注解

拍摄照片时启用或禁用默认快门声音。

默认情况下,当调用系统定义的相机快门声音时 #takePicture ,相机将播放系统定义的相机快门声音。 使用此方法,可以禁用快门声音。 强烈建议在禁用系统快门声音时播放 ShutterCallback 另一种快门声音。

请注意,设备可能并不总是允许禁用相机快门声音。 如果快门声音状态不能设置为所需值,此方法将返回 false。 CameraInfo#canDisableShutterSound 可用于确定设备是否允许禁用快门声音。

适用于 . 的 android.hardware.Camera.enableShutterSound(boolean)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

另请参阅

  • <xref:Android.Hardware.Camera.TakePicture(.IShutterCallback%2c+.IPictureCallback%2c+.IPictureCallback)>