2
我有一個選項來顯示UIImagePicker並從用戶的相機膠捲中選擇一個圖像在我的應用程序中。我遇到的問題是照片按最舊的頂部排序。這可以輕鬆挑選幾個月前拍攝的圖像。我希望用戶快速選擇幾分鐘前拍攝的圖像,而不必滾動到列表的末尾(列表底部)。iPhone如何使用默認的UIImagePicker選擇最新拍攝的圖像
有沒有要求默認的UIImagePicker排序其結果並顯示最新的或至少滾動到列表的末尾後提交?
- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
usingDelegate: (id <UIImagePickerControllerDelegate,
UINavigationControllerDelegate>) delegate {
if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO)
|| (delegate == nil)
|| (controller == nil))
return NO;
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
// Displays a control that allows the user to choose picture or
// movie capture, if both are available:
cameraUI.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
// Hides the controls for moving & scaling pictures, or for
// trimming movies. To instead show the controls, use YES.
cameraUI.allowsEditing = NO;
cameraUI.delegate = delegate;
[controller presentModalViewController: cameraUI animated: YES];
return YES;
}
Duplicate:http://stackoverflow.com/questions/3947157/uiimagepickercontroller-is-it-possible-to-change-the-sort-order-of-the-images-i – 2012-07-24 20:12:07