uiimagepickercontroller

How to select any Video or Movie file from UIImagePickerController

三世轮回 提交于 2019-11-26 10:36:06
问题 In my app, i need to select any video file and show the display the url for a video file in the application. -(void)viewDidLoad{ [super viewDidLoad]; self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.delegate = self; self.imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; self.imgPicker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie, (NSString *)kUTTypeImage, nil]; self.imgPicker.allowsEditing = NO; [self presentModalViewController

iOS7 iPad Landscape only app, using UIImagePickerController

此生再无相见时 提交于 2019-11-26 10:28:20
问题 I believe this is a common issue and many answers don\'t work anymore, many just partial, if you are under iOS7 and your iPad app is Landscape only, but you want to use the UIImagePickerController with source UIImagePickerControllerSourceTypePhotoLibrary or UIImagePickerControllerSourceTypeCamera . How to set it right, so it\'s working 100%? And you don\'t get mixed orientations and avoid the error \"Supported orientations has no common orientation with the application, and shouldAutorotate

UIImagePicker allowsEditing stuck in center

…衆ロ難τιáo~ 提交于 2019-11-26 09:30:06
问题 I have a UIImagePicker that works perfect for a type of UIImagePickerControllerSourceTypePhotoLibrary, but when I use UIImagePickerControllerSourceTypeCamera, the editing box cannot move from the center of the image. So if the image is say taller than it is wide, the user cannot move the editing box to the top square of the image. Anyone know why this would be the case? It only happens when the source is from the camera, not the library. Edit: Some CODE!!! if (actionSheet.tag == 2) { if

iOS 10 error [access] <private> when using UIImagePickerController

这一生的挚爱 提交于 2019-11-26 08:47:24
问题 I am using XCode 8 and testing with iOS 10.2 Beta. I have added the Photos, PhotosUI and MobileCoreServices frameworks to project. Very simple code: #import <Photos/Photos.h> #import <PhotosUI/PhotosUI.h> #import <MobileCoreServices/MobileCoreServices.h> @interface ViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate, PHLivePhotoViewDelegate> @property (strong, nonatomic) IBOutlet UIImageView *imageview; @end and implementation: - (IBAction)grab:

UIImage Saving image with file name on the iPhone

a 夏天 提交于 2019-11-26 08:27:49
问题 How can I save an image (like using UIImageWriteToSavedPhotosAlbum() method) with a filename of my choice to the private/var folder? 回答1: Kenny, you had the answer! For illustration I always think code is more helpful. //I do this in the didFinishPickingImage:(UIImage *)img method NSData* imageData = UIImageJPEGRepresentation(img, 1.0); //save to the default 100Apple(Camera Roll) folder. [imageData writeToFile:@"/private/var/mobile/Media/DCIM/100APPLE/customImageFilename.jpg" atomically:NO];

Force landscape orientation in UIImagePickerController

我们两清 提交于 2019-11-26 07:45:45
问题 I\'m new to iOS development, and Im developing my first app. (so sorry if Im asking a newbie question) My app is all in portrait orientation, except to the place where I\'m using UIImagePickerController to take a picture to be used in the app, what I\'m doing is: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];

Select Multiple Images (UIImagePickerController or Photos.app Share UI)

痞子三分冷 提交于 2019-11-26 07:39:10
问题 In iPhone OS 3.0, Apple added the ability to share multiple pictures at once using the \"Share\" button and selecting multiple images (where a checkmark is used). I\'d love to have a UIImagePickerController which lets the user select multiple images at once, rather than having to go one by one. Is there a way to do this, or do I have to wait until they add this feature? 回答1: Try this wonderful API in swift: ImagePicker. As all other image APIs, it is simple to use and it is very well updated.

UIImagePickerController in Landscape

血红的双手。 提交于 2019-11-26 05:26:43
问题 I have been searching for an answer to this, but cannot come up with anything. Apparently, iPhone SDK 3.0 made it possible that UIImagePickerController can be displayed in landscape mode - but I am not finding any method that will allow this. I would think that if the application is in landscape by default it would automatically adjust the image controller, but that is not working for me. Thanks for any help! 回答1: I haven't checked whether this is illegal, but it worked for me. If you want

iOS 8 SDK: modal UIWebView and camera/image picker

喜夏-厌秋 提交于 2019-11-26 05:22:24
问题 I have found that, when compiling for iOS 8 (and running in iOS 8), a UIWebView cannot show the camera/image picker if the UIWebView is in a view controller presented modally. It works without problem in view controllers directly “hanging” from the window rootViewController or view controllers pushed from it. The test application can be found at https://dl.dropboxusercontent.com/u/6214425/TestModalWebCamera.zip but I will describe it below. My test application (built with storyboards, but the

Detect permission of camera in iOS

跟風遠走 提交于 2019-11-26 05:18:08
问题 I am developing a very simple video app. I use the official control: UIImagePickerController. Here is the problem. When presenting the UIImagePickerController for the first time, the iOS will ask for the permission. The user can click yes or no. If the user clicks no, the control is not dismissed. Instead, if the user keeps clicking the start button, the timers go on while the screen is always black, and the user can\'t stop the timers or go back. The only thing the user can do is to kill the