Custom Alert view for iPhone - iphone

I am trying to implement my own alert view for an iphone app. The app supports all orientations and also often shows both a tabbar and navbar. Currently, I add my custom alert view as a subview of the active view controller - this works well as it supports a transparent overlay and rotation is supported. However, the tabbar and navbar are not covered by the alert view's overlay. I have discarded adding the alert to the keywindow as this does not support rotation readily and because of other issues with using the keywindow. Any suggestions on how to implement a custom alert with a transparent overlay that would also cover any nav and/or tab bar and also support rotation please?

Related

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 :).

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.

subviews show confused rotated state after a modal dialog is displayed

I've created a custom UIViewController that mimics the UISplitViewController. It manages two child view controllers that get displayed in the left & right body area while in landscape and hides the left to show in a popover when in portrait. It works fine, using the didRotateFromInterfaceOrientation: and willRotateToInterfaceOrientation: messages to reset the location and sizing of the child views. All the views and child controllers are loaded from a nib. This custom view controller is shown inside a UINavigationController.
The trouble arises after one of the child view controllers uses presentModalViewController. If the device was rotated after the views were initialized (but before the modal controller is shown), after the modal dialog is dismissed, the left and/or body views will be re-rendered in a different rotation than they were before the modal dialog was changed.
I'm wondering if folks have had a similar problem, and what the solution is. I'm sure sample code would be helpful, but it'll take a bunch of work to distill it into a runnable sample.
When I saw this same behavior in my split view app, I noticed that it only happens when I'm holding the device in "left home button" landscape. I had set my initial interface orientation to "right home button" but was allowing either left or right home button landscape orientations (no portrait orientation for this app). My solution was to no longer support left home button landscape orientation and now all post-modal subviews display reliably.

Process touches behind the UINavigationBar

In my application, I'm displaying a fullscreen image in a 320 x 480 frame. After I display the image, I fade the navigation bar out to allow the user to see the whole picture. When the user taps in the area where the navigation bar was, I would like to bring the navigation bar back.
This is very similar to what happens in the iPhone Photos app.
Unfortunately, after I've hidden the UINavigationBar, I can't process touches on the screen where the navigation bar once was. I believe this is because the origin of the parent view is right below the navigation bar:
Nav Bar http://shortybox.com/navbar.gif
How can I process touches in this area to bring the nav bar back?
You can override hitTest:withEvent: on UIWindow. See this answer.
Are you fading out, and then removing the bar from its superview? If you just set its alpha to zero, it will still trap your clicks. Try removing it, or hiding it.
It looks like there isn't currently an easy solution to this. The default UINavigationBar is gobbling up all of my events. I ended up hiding the default navigation bar throughout my entire application, and adding a dummy UINavigationBar in interface builder.
By doing so, I lost the default "Back" buttons that come with the NavigationController, but the app is now functional.

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.