I want to customize new camera overlay view, so need figure out one way to put new view above self.imagePickerController.cameraOverlayView.
I have tried those ways
[self.view bringSubviewToFront:self.imagePickerController.cameraOverlayView];
[self.imagePickerController.cameraOverlayView bringSubviewToFront:self.view];
[self.view insertSubview:self.view aboveSubview:self.imagePickerController.cameraOverlayView];
But none can work.
Seem that the only way is
self.imagePickerController.showsCameraControls = NO;
Therefore build my own components like iPhone.Camera
I think the idea with the cameraOverlayView is that you use this as a base UIView for anything you'd like to overlay on the camera view. This main overlay view can be transparent, and you just need to place whatever views you want to overlay on the camera as subviews of it.
You can order these subviews however you want within the overlay to achieve the desired visual effects.
Additionally, I recommend watching the WWDC 2010 video session 421 - "Incorporating the Camera and Photo Library in your App", where they go into detail on how to manage camera overlay views. I believe that Apple's PhotoPicker sample application also shows this off.
Related
I am new to iphone development, and i am wondering how would i go about placing a page control as an overlay for the camera, so that a user could swipe and different overlays would be shown for each page? This would have similar features as the The Sampler by Converse.
Firstly there will be the camera
on top will be a scroll view (paginated)
each page will hold an image that is overlayed over the camera
4.(extra) i would like that image to zoomable
How would i go about writing this, or could someone point me in the write direction cause i am new to iPhone dev,
You could use a UIScrollView with paging enabled, as someone else noted. There are some examples out there already of how to do this. Check this one out: https://github.com/mwaterfall/MWPhotoBrowser.
My best suggestion would definitely be to checkout the source for the PhotoScroller app by Apple: http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html
Just add a UIScrollView to your view and add the images as subviews to your picker. Make sure you enabled Paging on the scrollview as well.
You would need to use the cameraOverlayView property of UIImagePickerController
The cameraOverlayView will essentially be a paginated scrollview, you can follow this sample code to see how to create and use cameraOverlayView:
PhotoPicker
Play with OverlayViewController in the above code and you'll achieve it.
For the zoomable image, you just would add a scrollview and display the image in it. The UIScrollView delegate has this method:
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale.
I'm quite new to iPhone development, and now dealing with a remote control app. Currently I can receive desktop image and perform simple mouse operations. But I still want to show a mouse pointer on my iPhone screen.
The desktop (very big, 1280X800) is in a image view which is the subview of a scroll view. Is there any way I can add a pointer image on top of the desktop image, and set it to any place I want? The pointer image do not receive any user interaction, it would be just floating on the desktop image.
Thank you very much for help.
Yes, just create a new UIImageView (or any other UIView subclass) with a frame based on where you want it to appear and add it to the scroll view's view using the addSubview: method. By default subviews you add later will appear above subviews you add earlier, but you can explicitly control which view appears on 'top' using 'bringSubviewToFront:'.
When we creating application with MPMoviePlayer (within custom UIViewController) and with overlay UIViewController on top of movie player what is better:
- Load movie in player with self.view.presentModalView... or self.view.addSubView...
Or is there any other better way. I now work with modal views and everything works except I have to implement some custom rotations. I am looking for more clear way to make this.
Ok maybe some more details. In iPhone app I add player like modal view and add overlay view to it and that works. But this is universal app and it doesn't work on iPad the same way it works on iPhone. In ipad splitView my player is on details side (nonfullscreen), when I double tap player it goes fullscreen. And now player is key window. Here is the biggest issue. I tried to add overlay view as subviw and modal view and I made it but that overlay is not aware of device orientation, and I have to transform overlay elements and this is what I am trying to avoid. Is there any way to detect rotation on that view?
Simple and most elegant solution:
Do not use the "real" fullscreen mode but scale the MPMoviePlayerController's view towards a screen-filling size - MPMoviePlayerController.view.frame = CGRectMake(0.0f, 0.0f, 768.0f, 1024.0f);. Keep the MPMoviePlayerController's view on top of a regular UIViewController's view that allows rotations (addSubview). Keep your custom interface view on top of the MPMoviePlayerController's view (addSubview) and presto, you will get a properly rotating video player no matter if you run it in "fullscreen" or not.
I found one solution but I am not very proud because I this that there is some better way, but this workaround works:
- In project I have on singleton class that contains some global data for me.
- When application start in detail view (UISplitView) willAnimateRotationToInterfaceOrientation method is called first. Here I get current orientation and store it in singleton class.
- Later when I add overlay on top of player I read data from singleton and transform overlay elements.
According to above I did something like this:
mp = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:#"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]];
mp.movieSourceType = MPMovieSourceTypeStreaming;
mp.view.frame = CGRectMake(0.0f, 0.0f, 1024.0f, 768.0f);
[self.view addSubview:mp.view];
mp.controlStyle = MPMovieControlStyleNone;
[self.view addSubview:self.myOverlay];
[mp play];
Actually it was so easy! Just choose control style to None and add your low opacity view on the player view.
I am building an Iphone app.
I need to display a settings Menu to the user when a button is clicked. The menu will NOT be covering the whole screen and there is a specific location I want it to appear. How should I do that?
I understand how to set the hidden property of a subview to give the illusion that the subview is not onScreen. However, I need a view controller for this subview ( meaning .m and .h files as well). So How can I add this subview programmatically at a specific location.
Thank you very much
What you are describing is very much the behavior of a UIPopoverController. Unfortunately, that is only available for use on iPad's and not iPhone's or iPod Touches. So if you want to develop this you will need to develop this from scratch.
It's not a UI pattern you see much on the iPhone due to the screen size, but I imagine you will need to build up a custom UIView and add it the main window view with a specific size (smaller than screen size) and with the view's frame.origin set to a value other than (0,0).
Just make sure that what you are trying to achieve falls within Apple's Human Interface Guidelines.
[myView addSubview:myViewController.view];
myViewController.view.frame=...
I am trying to put an OpenGL View into my application but I want to make sure that before I do this that the view is transparent because I want to see and interact with the view behind it as well as the OpenGL View. Meaning I want to have something on an OpenGL View as well as the Image View behind it
You can have a view with a clear background and see the views behind it but you will not be able to have the user interact with the views that are behind.
Set the background color to [UIColor clearColor]