カスタム カメラ オーバーレイに、このメソッドを呼び出すボタンがあります。
- (void) changeFlash:(id)sender
{
//UIImagePickerControllerCameraFlashModeOff = -1,
//UIImagePickerControllerCameraFlashModeAuto = 0,
//UIImagePickerControllerCameraFlashModeOn = 1
NSLog(@"before %d", self.picker.cameraFlashMode);
switch (self.picker.cameraFlashMode) {
case UIImagePickerControllerCameraFlashModeAuto:
[(UIButton *)sender setImage:[UIImage imageNamed:@"flashOn"] forState:UIControlStateNormal];
self.picker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOn;
break;
case UIImagePickerControllerCameraFlashModeOn:
[(UIButton *)sender setImage:[UIImage imageNamed:@"flashOff"] forState:UIControlStateNormal];
self.picker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff;
break;
case UIImagePickerControllerCameraFlashModeOff:
[(UIButton *)sender setImage:[UIImage imageNamed:@"flashAuto"] forState:UIControlStateNormal];
self.picker.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
break;
}
NSLog(@"after %d", self.picker.cameraFlashMode);
}
self.picker.cameraFlashMode は、変更の前後で常に 0 です。私は何を間違っていますか?
また、UIImagePickerControllerCameraFlashModeAuto でスタックしていると思われる場合でも、フラッシュは機能しません。