[英]iphone : how to stop shutter animation?
我有2個問題。
1)我想知道如何在相機加載時停止快門的animation? 我正在使用 UIImagePickerController。 我已經從堆棧溢出中引用了許多答案,但沒有成功。
2)我在相機中有一個使用cameraOverlayView
的自定義按鈕,並且想在點擊時打開照片庫。 我有如下代碼:
- (void) showLibrabryPicker
{
pickerLibrary = [[UIImagePickerController alloc] init];
pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerLibrary.delegate = self;
[self presentModalViewController:pickerLibrary animated:YES];
[pickerLibrary release];
}
當相機已經顯示時它會被調用。
謝謝...
使用UIImagePickerController
,您對初始快門 animation 無能為力。 它實際上是為了隱藏啟動時間。 您可以切換到使用 AVFoundation 並獲得一個沒有快門 animation 的AVCaptureVideoPreviewLayer
,但是在請求開始和開始之間仍然存在延遲。 我不是硬件專家,但我認為延遲是因為電源管理單元通常會關閉整個子系統。
您的showLibraryPicker
代碼看起來或多或少是正確的,盡管您可能在錯誤的演員上調用了presentModalViewController:animated:
:。 UIImagePickerController
是一個視圖 controller,所以如果你沒有對它進行子類化(即,你正在編寫的代碼本身並不是你作為UIImagePickerController
的一部分)那么你會想要做[pickerController presentModalViewController:...]
.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.