今天发现,拍照功能,直接返回,app就崩溃了!正常拍照没有问题:
procedure TCustomListViewCameraDoc.actCameraExecute(Sender: TObject); var Service: IFMXCameraService; Params: TParamsPhotoQuery; begin inherited; if TPlatformServices.Current.SupportsPlatformService(IFMXCameraService, Service) then begin Params.Editable := False; // 拍完照是否允许编辑 // Specifies whether to save a picture to device Photo Library Params.NeedSaveToAlbum := False; // 是否保存到系统相册 Params.RequiredResolution := TSize.Create(2000, 2000); // 拍照大小,每张照片有固定宽高比例,系统会自动处理,给它一个想要的大约值就行。 Params.OnDidFinishTaking := CameraActionDidFinishTaking; // 拍完照后触发的事件 Params.OnDidCancelTaking:=CameraActionDidCancelTaking; Service.TakePhoto(nil, Params); // 打开相机,开始拍照 end
看上面代码,接管了OnDidCancelTaking,问题解决!实际上CameraActionDidCancelTaking,什么也没做。
procedure TCustomListViewCameraDoc.CameraActionDidCancelTaking; begin end;
这得算bug.