iPhone: Camera Overlay can fit in a Tabbar Viewcontroller? - iphone

I have a Tabbar application, where clicking on a tabbar item, i should show a Camera Overlay view , BUT it should not HIDE the tabbar, Camera overlay should just fit into the tabbar viewcontrollers, just like behind the tabbar view. I created a custom camera overlay and called UIImagePickerController to my customer camera overlay. But it opens up with full screen mode and hides my tabbar etc.
pickerController.cameraOverlayView = camCumtomOverlay;
I even tried resized the custom camera overlay to small like below, but it open up the camera view with full screen and hides my entire tabbars.
myOwnOverlay = [[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 300)] autorelease];
But i want to to fit that custom camera overlay into tabbar.
Could someone please advise me how to achieve it?
Thanks!

I presume you're using presentModalViewController: to present the picker. Modal view controllers will go over everything that's behind, so the tabbar will hide as well. You can add a tabbar in the overlay that acts the same as the main tabbar.

Related

Creating a View popup over another ViewController on iPhone

I am trying to make some kind of popup view when a button i pressed on the iPhone. And it would be nice if I could manage that popup view with a ViewController. I have found out that the UIPopoverController could have been the solution, but it seems that it only works on the iPad...
But anyway, are there any similar solutions for the iPhone?
I am using storyboard
Check out these repos on Github:
https://github.com/werner77/WEPopover
https://github.com/50pixels/FPPopover
Create a separate view controller and resize its xib file and make it look like a popup.
Then ADD this view controller as a subview, and also add it as childController too.
[self addChildViewController:self.popOverViewController];
[self.view addSubview:self.popOverViewController.view];
Now Make it hidden initially.
self.popOverViewController.view.hidden = YES;
If a user taps on Button then using fade in & Fade out animation you can hide/unhide it.
I can tell you how to fade in and fade out if you want to know it further, I hope you can do it easily.
In interface builder make a UIView size of the screen and then make another in that Uiview with the style, size and the such for your pop over. Make its class, hook everything together.
CustomPopUpView *view = [[CustomPopUpView alloc] initWithFrame.....]
Add this all to your UIViewController with
[self.view addsubview:view]
Then attach a tapGestureRecognizer to the back view that animates the whole view off screen when tapped. So now if they click off your pop over view it close it will animates it off screen.
Hope this makes sense.
BooRanger

UIImagePickerController's top navigation view and bottom toolbar is going behind my view

In my application in RootViewController i have added a top custom view with titleview & a button similar to UINavigationController and bottom Custom View similar to UITabBar in between i'm having a view(say, contentView) with 320 x 280 dimension view in which i'm adding different different subview as per the user selection of tabs.
In one tab inside my contentView i have a button to open camera, there i'm presenting Camera or PhotoLibrary like
[self presentModalViewController:imagePicker animated:YES];
but is presenting inside my contentView, so that capture button & camera controls are going behind my navigation bar,below is the snap. Img 1. is normal scenario, but for me its like img.2
How to overcome this,Any help is thanks in advance.

How can I restrict modalViewController in Landscape?

I am working on iPad application where I am showing some view in modalView controller.
In Landscape, when I click on UITextField for taking some input modalview controller goes up and keyboard appears.
But I have changed the height of modalViewController and I dont want the modalView goes up for keyboard. How can I do this? Any help?
In the UIViewController's code, where you move its modalViewController, check if the interface orientation is not landscape
if(([self.interfaceOrientation!=UIInterfaceOrientationLandscapeLeft])
&&([self.interfaceOrientation!=UIInterfaceOrientationLandscapeRight]))
//your code to repostion the view controlled by the modalViewController
I guess you have to use custom presentation code. You cannot change the scrollup behaviour, when the keyboard appears.
You could add a 1024*768 sized black transparent view on top of the window and then your view on top of this. But you would have to build your own borders around your view in that case. Probably there are some open-source implementations of a modal popover. You can search for that on cocoacontrols etc.

iPhone - pushed view blocked by invisible toolbar (?)

I have this UINavigationControl that has its toolbar visible and is showing the RootViewController. Then I push a new viewController into the screen but I like the toolbar to be invisible, while this other viewController is being shown.
Then, to show the viewController and hide the toolbar of the UINavigationControl I do this:
self.navigationController.toolbar.hidden = YES;
UIViewController *newVC = [[UIViewController alloc] init];
[self.navigationController pushViewController:newVC animated:YES];
The problem is that any touch on this new view controller in the are correspondent where the toolbar was visible on the last view controller is not detected.
As you know, the toolbar sits on a rectangle at the bottom of the screen, has the screen width and 44 pixels high (if I am not wrong). So, the new pushed view controller responds to touch on its full view are except those on this rectangle.
See the following picture. I have 3 buttons. Buttons 1 and 2 will respond to touches, but not button 3, because it is inside the area where the toolbar of the other view was...
And more than that, if I paint the background color of the new view with red, for example, the whole screen will be red, except for that bottom rectangle that will be white (and white is not the color of the previous view). I have checked and the view has 320 x 480...
any clues? thanks.
I think you are looking for hidesBottomBarWhenPushed property of a UIViewController.
See this related question here.

Fixed background image, that doesn't move when new views are loaded

I have an iPhone app with a navigation controller. Views slide in from the right. I want a background picture that is fixed, so that it doesn't slide with the views pushed on the nav controller. Is that possible?
Thanks!
You should be able to, for example, add a UIImageView with your background image as a subview of your app's UIWindow, underneath the UINavigationController's view. Then set the background color of each UIViewController to [UIColor clearColor], and the static background image should show through.