how to hide/ show custom toolbar(s) in a subclass of uiimage picker controller - iphone

I subclassed uiimagepickercontroller for a camera based application, and added two custom tool bars.I want to navigate to another viewcontroller before taking a photo and the custom tool bars hidden in the new view.Till here it is working fine.But when i pop back to camera view controller,the tool bars are still hidden.Where exactly should i write the code to unhide the toolbars?? I wrote the code to unhide in viewWillAppear method of camera class.But it is not working

it is correct to write the code under viewWillAppear, but it should be in the viewController (UIViewController)

Related

How to change location of PageController indicator

How do you get the page indicator (dots) to not block the bottom of the screen. I started a basic page based app template, implemented the UIPageDataSource methods to show what page is being displayed. But its blocking the bottom of my screen. If I change the PageControl background to clear its clear but it still takes up the bottom of the screen. No view wants to overlap it. I want the PageControl to be placed anywhere, and a view under it that takes up the whole screen.
My guess is that you're using a UIPageViewController. Which pr.default includes the UIPageControl element.
If you convert your app into using a regular UIViewController and manually adds the UIPageControl in the .xib(or storyboard) implement the DataSource and Delegate protocols. Then you'll be able to move the UIPageControl anywhere on the scene of your .xib or storyboard (whatever you use).
Basically it's the same thing as when you manually adds a UITableView to an UIViewController instead of using a UITableViewController.

Load a view controller created inside a storyboard as a subview (into a part of the screen) of another view controller

I am currently developing as app for iPad. And I need to create a tabbar. The problem is that, for design purposes, I need the tabbar to be on the top half of the screen and not on the bottom as it is on the default tabbar controller.
Once the tabbar is on top I want that when a button is touched, the subview bellow the tab is changed. Furthermore, the subview that should be loaded was alson designed inside the storyboard. The following sketch shows what I want it to look like:
On my research I found a solution (here) for putting the tabbar on top. Now my problem is on loading a subview bellow it.
I tried it with [self.view addsubview:theNameOfTheViewCreatedINStoryboad.view] but the application simply hangs when I press the button.
I think that is because I am not specifying anywhere what should be the dimension of the new view or where on the scree should it be placed. The reason for that is because I do not know where it should be done.
Can anyone give me some lights on this matter? Is the referred approach the best one for putting a tabbar on top? How can I solve the subview problem?
Glad to see you are using a toolBar and not a tabBar. Even better would be to create a custom content view controller.
You should be looking into using containment:
UIViewController containment
How does View Controller Containment work in iOS 5?
positioning UIViewController containment children
check out the docs

IOS 5 SDK and Segues

I am creating a project with Xcode 4.2 and using it's storyboard. In one of the views I have a button that a user will tap and it will perform some calculations. If the calculations are correct I need to display the view that they just came from. I am currently using a Navigation Controller. When the app starts it loads View 1. When I choose an option it loads View 2. If I click the 'back' button in the toolbar it loads View 1 with left animation.
In my IBAction method for the View 2 calculation I have the following snippet.
[self performSegueWithIdentifier:#"BackToView1" sender:sender];
But the problem is it loads View 1 using the left animation when I need it to load the right.
Would that be a custom segue? Am I missing something?
[Edit]
I just noticed something as well. When View 1 loads from my IBAction it appears it is initializing the AppDelegate again, whereas the 'back' button does not. I need to not initialize the AppDelegate since I am loading a data object at the start of the app. Calling init again kills my object.
You could try using the navigation controller to pop back. This will probably produce the effect you are after.
[self.navigationController popViewControllerAnimated:YES];

2 UITableViewControllers vs 1 UIViewController that swaps two UITableViews

I have a navigation controller that works with two UITableViewControllers. The first UITableViewController shows the user a list of their picture libraries, and when they tap a cell, the second UITableViewController gets pushed on the stack and displays the pictures in the library (much like a UIImagePicker). What I want to do is, when a user selects a photo library on the initial UITableViewController, I want the navigation title to not animate, while the transition of UITableViews does animate. Is there a way to accomplish this, or do I need to implement a UIViewController that swaps in two UITableViews (upon then I'm not sure if I'd be able to edit the back button after the second UITableView gets swapped in?).
I'm pretty sure that the easiest way would be to add two UITableViews into a UINavigationController's view and just animate them with [UIView beginAnimation] in a didselectrowatindexpath. You should also have a flag to save a view state - either a library picker view is shown to user or an image picker. Then you'll be able to handle this properly in a back button selector.
That's the easiest way IMO.
I'd recommend one UIViewController and animating the frames of the table views to transition between them.

UITabBarController Hide Show Bars with animation like the Photo APP

i'm having a real trouble with UITabBarController. I have a simple foto app, and I'm trying to simulate almost the same behaviour as the PhotoApp from the Iphone
the main view controler is the tabbar itself, i also have a NavBar and a status bar on top.
What i want is on tap to hide the bars (not with timer, just on tap).
The photo is actually an UIScroll view that zooms the photo or makes it again 1:1. that part already works,
I've tried before pushing the view to the navbar to set the hidesBottomBarWhenPushed and well it works, but i can't set a custom animation, and that's not the real problem , I can't show again the bars, they dissapear and i don't know how to reshow them, i'm sure i'm probably missing someting very obvious, but as my experience in obj C is little like half a year part time, i thought i asked here as stackoverflow seems to get the answers :)
Something to investigate: the Three20 project: http://github.com/facebook/three20 - it includes a completely clone of the photo-browsing app in component form.
But without Three20, you can't do this with a stock UINavigationController, because the UIViewController that you're using is a subview of the UINavigationController. You need to make a sibling view on another layer. To do this, make a parent UIViewController which has two subviews: your photo, and a UIToolbar. You can hide and display the UIToolbar by setting it's hidden property, and make sure it's above the photo view with [parent.view bringSubviewToFront:toolbarController] (where parent is the main UIViewController that contains both the photo view and the UIToolbar)