UIActionSheet... How to implement UIImagePicker? - iphone

I'm new to iOS developement... I want to add 3 buttons on this view: cancel, choose from library and take from camera.
I already know the UIImagePicker method.
Thanks

Ciao Davide, reading UIImagePickerController Class Reference should be useful:
You can customize an image picker controller to manage user interactions yourself. To do this, provide an overlay view containing
the controls you want to display, and use the methods described in
“Capturing Still Images or Movies.” You can display your custom
overlay view in addition to, or instead of, the default controls.
Custom overlay views for the UIImagePickerController class are
available in iOS 3.1 and later by way of the cameraOverlayView
property. For a code example, see the PhotoPicker sample code
project.
Here there is UIImagePickerController Class Reference:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
And here there is PhotoPicker sample code:
http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010196

Related

iPhone camera toolbar buttons

The iPhone camera toolbar holds the following buttons: cancel/record
I would like to change the cancel button to the small image button that takes me to the photo library.
I wasn't sure if i need to use the overlay or does the xcode have something more comfortable in this case since this is something well known and used.
Is there something like this?
Thanks,
You can set overlayView to your UIImagePickerController
imagePicker.cameraOverlayView = yourOverlayView;
UIImagePickerController Class Reference
You can customize an image picker controller to manage user interactions yourself. To do this, provide an overlay view containing the controls you want to display, and use the methods described in “Capturing Still Images or Movies.” You can display your custom overlay view in addition to, or instead of, the default controls. Custom overlay views for the UIImagePickerController class are available in iOS 3.1 and later by way of the cameraOverlayView property. For a code example, see the PhotoPicker sample code project.

UIImagePickerController pushed on my own UINavigationalController?

I'm trying to take the UIImagePickerController set to UIImagePickerControllerSourceTypeCamera (ie when it allows the user to take a picture) and push it on my own UINavigationalController but it doesn't work (can't push a UINavigationalController onto another UINavigationalController).
I'm wondering, is there anyway to make a custom version of this camera module, much like you can do with the UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerController using ALAssets? I'd just like to not have to pop up the camera as a modal view and would like to push it on my own UINavigationalController.
You can custom camera using AVFoundation.
Refer Sample AVCam for how to use AVFoundation for it.
Your main issue is that the UIImagePickerController is itself a UINavigationController, so pushing that onto a navigation controller is going to have problems (as you've already found)
As Prince has mentioned, your best bet is to use the AVFoundation to create your own. The downside is you'll (by default) lose the nice features of the camera app such as touch to focus, pinch to zoom etc. but these can all be added yourself.
Check out this tutorial which gives you a nice explanation on how to use the AVFoundation library for this, and also shows you how to add things like an overlay to the camera screen. Then you can easily find on google/stackoverflow how to add things like tap to focus :)

UIImagePickerController both camera and library

I would have though that the UIImagePickerController would allow you to use the camera or choose from the library from within the view? It seems I have to pick one or the other cia the sourceType? Is there no way to add a button to the choose library view to switch to camera?
You would have to implement this yourself. You can make a simple UISegmentedControl and when the value is changed, you change the source of the UIImagePickerController.

Custom button instead of the default button on the camera iphone 4

I know you must do to take a picture with a button that was created by me and not the default one.
Also as you can remove the preview that comes after taking a photo?
Can you help?
Use the showCameraControls property of UIImagePickerController to show or hide the default controls
Use the cameraOverlayView property of UIImagePickerController to provide your own view to display atop of the camera view. You can then assign this property a custom UIView that will contain your own UIButtons
Use the takePicture action/method of UIImagePickerController to ask the camera picker to take a picture. You will typically call this method in the action of your custom button.
Read the documentation and the Programming Guides ;)

Creating a custom UIActivityIndicatorView

I want to have a custom view for UIActivityIndicatorView rather than relying on options given by iOS. How can I create my own view here?
I have a list of images with me to create a animated view.
As you haven't specified the case in which you want to use the activity indicator,
check the below tutorial blog for custom UIActivityIndicatorView,
Custom UIActivityIndicatorView (EDIT: This link is gone)
Showing a "Loading..." message over the iPhone keyboard
This is implementation of custom UIActivityIndicator from scratch ready for integrating.
Abhinav, if you want to use a set of images you could as well use a UIImageView. Set the animationImages and start-stop as you wish.
This one looks nice and clean, can be hooked to the code easily too.