iPhone development - how can I implement transparent overlay view? - iphone

I'm now working with view-based application. It's just simple. If I touch the view, the view flips using animation ability of UIView. This is all.
What I want to do after this...is...locating a kind of button in the middle of the main view. BUT!, the button must not be animated while the main view is flipping.
How do I do this?

I dont know this is a correct way or not and i havnt tried this. Just a thought.
Create a UIButton in appdelegate and add that button as subview to the UIWindow.
So you can access that button in anyview and so that you can keep that button in the front and change view controllers.

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

Present UINavigationBar + toolbar modally from UIScrollView

I am creating a reader app and have the kindle app as an
inspiration.
From the reader view (uiscrollview) I wish to present/animate a navigation bar
and toolbar on a tap. Now the app (uiwindow) already has as its root view controller
a navigationVC, which is used for the flow for selecting book category and a book. I then make the top bar invisible when displaying the actual text in my uiscrollview.
I want to display that navigationVC again on a tap, is that possible? I tried in my uiscrollview bind a tapgesturerecognizer to present that controller modally but it didn't work.
Thanks!
It works now, it wasn't as advanced as I thought. Actually, I had an error in my gesturerecognizer handler, which didn't set the UINavigationController's properties :).

Subview behaves strangely in navigation-based app

I'm currently developing an app for iphone (my first) and I used several UITableViewController for navigation.
I then used a subview attached to self.view.superview to get a non-scroll image at the top.
The subview is created in IB, simple UIView with an UIImageView in it.
I'm adding the subview in viewDidAppear and this functions well.
But as soon as I'm tapping a cell and the navigationController pushes the next View animated, the previous view (scrolling out of sight) becomes completely white and my subview moves animated to the center. It's only for a half second or so, because then it's gone due to the next view arriving, but it's really unnerving.
I tried removing the subview in viewWillDisappear, that removes the UIImageView, but the screen still becomes completely white.
Does anybody how to fix this?
Oh, and PS: I'm working only on the Simulator, because I have no Developer Account yet. And I cannot change everything to a ViewController because I have a deadline to meet.
You shouldn't be surprised that things go wrong when you mess with the views of view controllers that don't belong to you. Rather than using a table view controller, you should replace it with a custom UIViewController whose view acts as a container view for both the table view and the non-scrolling view above it.

iPhone Toolbar on top of a Scrollview to save UImage?

ive been looking at some tutorials on a toolbar they all are implemented through the navigation controller delegate. Is there a way i could use the toolbar without using the navigation controller?
right now i have a ViewController with a Scrollview in that scrollview i have images when the user uses a touch gesture then i want a toolbar to be viewable and usable to the user just like on the Photo App.
i want to know how i could use the toolbar and make it functional without going through the app delegate and staying on the current viewController.
A toolbar can be created and positioned just like any other view. Don't confuse toolbars with tabbars.

Showing a view controller from an OpenGL view

I have created an iPhone application based on an OpenGL view. Now I
would like to show a "settings" form. Since my code runs in UIView, I have no pushViewController. How do I show a view controller on screen?
Thanks!
You can do this in one of two ways:
You can create a new view hierarchy, and then add it as a subview of your UIWindow when you want to show preferences. When you're done with your prefs, you can animate it out and then remove it as a subview.
You can switch to a UINavigationController/UIVIewController based hierarchy, and hook your current OpenGL/UIView to a UIViewController's view outlet. Then you can use all the regular UINavigationController based navigation stuff.