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]
Related
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.
My app is structured like this, a single MainWindow with window backgroundColor to white(which doesn't appear anywhere anyway), and in this nib i have a UINavigationController which doesn't seems to have a backgroundColor.
Any view controller is added from code and made from code and they have a gray background.
What happens is that when i rotate the iphone and the views are rotating as well, i see a black background under my views. Can this be changed? It looks ugly especially if i have a photo that is rotating in the same time with my gray background.
You need to use the embedded view in the UINavigationView
When you are your UINavigationview Class :
self.view.backgroundColor = [UIColor greyColor];
Or any other color you want.
Change the backgroundColor of UIWindow in the file 'MainWindow.xib'
I'm interested to making a "fade effect" like Foursquare app. I want the main view to fade in.
How can I do this?
Sincerely I don't know what should I use. If anyone have the Foursquare's app on his iPhone, please open and see what I mean.
You should look at these answers:
How can I display a splash screen for longer on an iPhone?
This is what I've used in almost all of my apps:
http://iphoneinaction.manning.com/iphone_in_action/2009/05/creating-a-splash-screen-splashview-11.html
Displaying a "splash screen" and using the "fade effect" are really two different questions. As for fading, UIView has a bunch of built-in animations you can use which is provided by Core Animation. Look into the UIView docs Apple provides for these type of view animation.
The splash image is white with a fake nav controller on the top.
When the app finishes launching, the splash image is redisplay on top.
The typical UIView elements are added beneath the second splash image.
When this is finished, the second splash image transparency is animated to fully transparent and thus causes a "fade effect".
In augmented reality app,on Camera view another transparent view will be, On this transparent view, we used for drawing on camera view and saving it, can you suggest (Start and end) me how to work with this application,
thanks you, have a great day
You'll want to use a UIImagePickerController to show the camera preview. Set its showsCameraControls property to no, so none of the standard photo-taking interface is visible. Now, UIImagePickerControllers have a nice little cameraOverlayView property that you can use to place any view you want over the camera preview. Depending on what precisely you want to augment your reality with, this view could be realized in different ways. For example, if you want to overlay 3D models over the camera preview, this view could be a transparent OpenGL ES context. If you don't need any 3D assets, it can be a regular transparent UIView on which you draw some custom graphics with Quartz. It's up to you, but you want the general pattern of:
UIImagePickerController with showsCameraControls = NO
set cameraOverlayView to some transparent view to render content
This is really a huge question, and there are tons of intricacies depending on the specifics of your design. This is just a general summary.
In my camera function i have an custom overlayview, its is a square in the middle of the screen. Works all fine on the iphone 3gs but if I am launching it on my iphone 4 im getting troubles with the button to switch to the front camera, somehow it gets blocked by the overlayview. How to fix this?
Thanks in advance,
Dave
Hay, same problem, but another solution:
your_overlay.backgroundColor = [UIColor clearColor];
your_overlay.userInteractionEnabled = NO;
Your overlay view is probably sitting in front of the camera controls in the view hierarchy.
Try setting the backgroundColor of your overlay view to something like [UIColor greenColor] and running your app to see if it is showing up over the camera control. If you see that your app's new green background color is covering the camera control, it means that your view is blocking input events to the control, even when your view's background color is clear. You'll need to resize and reposition your view's frame so it doesn't cover the camera control.
When you're done, just get rid of the line in your code where you're setting the background color of your view to green.