Monday 15 September 2014

ios - Using UIImagePickerController in UIView -


I have a button, when I display the camera (works perfectly)

  - (IBAction) Millphoto: (ID) Sender {NSLOG (@ "button clicked!"); Image Picture = [[UIMJPC Controller Alok] Init]; ImagePicker.delegate = self; If ([UIImagePickerControllerSourceType is available: UIImagePickerControllerSourceTypeCamera]) [[imagePicker setsource type: UIImagePickerControllerSourceTypeCamera]; } Else {// If the device does not have a camera, then use the photo album [Image Picture SetSource Type: UIImagePickerControllerSourceTypeSavedPhotosAlbum]; } [Self-add subview: imagePicker.view]; }   

After that I can take an image, etc., but when I click on "Use": nothing here happens My method: Image Picker does not dismiss your screen Does: The application is just nothing, I am trying to take the image which I have taken and display it inside the CGRact on the screen. image picture controller: (UIImagePickerController *) was picker FinishPickingMediaWithInfo: (NSDictionary *) Information {[Picker Burning Viewer: Unknown: Yes Completed: Zero]; UIImageView * Patient Image = [[UIImageView alloc] init]; PatientImage.frame = CGRectMake (625, 25, 83, 103); UIImage * Chunazes = Info [UIImagePickerControllerEditedImage]; Self.patientImage.image = Selected Image; }

Even when I suppress the cancel button when I do not take an image, then the camera (camera interface) does not dismiss itself

any help Advice, or guidance, much appreciated.

what getPhoto: method UIView subclass?

If this is the case, then better than this:

  1. getPhoto: Delete the code UIView from the sub-class Out completely, and puts it in the original view controller of view.

  2. Create a property with your UIButton of your UIView: @property (nonatomic, strong) UIButton * myButton;

  3. In your view controller, set the goal of the button & amp; Action as follows:

      [myView.myButton addTarget: self-action: control events for @selector (GetPhoto :): UIControlEventTouchUpInside];  
  4. Finally, in your getPhoto: method, call [current current viewcontroller: animated image picture: yes complete: zero]; Your - (zero) image picture controller: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) information code should also go myView.patientImage.image = selectedImage; self.patientImage.image = selectedImage for

No comments:

Post a Comment