Does anyone have any info or code on how to can hide a navigation bar and toolbar when the user touches the iphone screen.
Basically I have an image gallery and I want to see the images in the whole of the iphone screen.
also im trying to implement a button so the user can download the image i had no luck on my search on google.
Thanks
[self.navigationController setNavigationBarHidden:YES animated:YES]
as I remember, there is smth like setHidden: method for any view. toolbar is a view.
handling touches. see touchesBegan:withEvents: in UIResponder.
you cannot download image? how do you try to do it? what the problem is?
Related
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
I have a uiwebview in a navigation bar which is in turn inside a tabbar item. I want to know how to hide the tabbar and navigation bar the moment the user takes off his finger from the screen just like hiding the toolbar in the default photos app in the iPhone.
I should also be able to show the tabbar and the navigation bar when i touch my uiwebview again.
By default, a UIWebViewDelegate is not equipped to receive touch events... however, if you subclassed the UIWebView as UIControl (which can accept touch events), you could link the UIWebView's touchUpInside: method provided by UIControl to code that hides the navigation bar.
To hide the navigation bar, you could use:
[self.navigationController setNavigationBarHidden:YES animated:YES];
Then, you could use similar UIControl implementation do detect when a finger has left the UIWebView, etc.
i have a UIViewController that is only about 260px tall(or at least the area i want viewable is 260 approx. height) and really just has a picker on it and a done button. I'm calling presentModalViewController to display it but its showing the whole view, when really i only want to show the picker and the done button bar above the picker,
not the black above the bar
, is there a way to show only this and not the whole view behind the picker when it is presented ?
alt text http://img202.imageshack.us/img202/1754/picker.jpg
not too much for code here, ....
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:tipPickerController];
[self presentModalViewController:navigationController animated:YES];
let me know if i should post more code to get help, thanks
Direct answer to your question:
You don't have to use a full screen view (320 X 480). You might set the view for the exact size that you need (without the black part on the top).
My suggestion:
Set the view for full screen, but in addition set a transparent color for your top level view (instead of black).
This way the original view won't be interactive while the picker is visible...
I am on a quest for the same thing. I found these resources.
How to make a UIPickerView slide half way up the screen?
Add UIPickerView & a Button in Action sheet - How?
The short answer is that a modal view controller is not what you want to use for this. It will work on an iPad but on an iPhone/iPod the modal view controller kills the first view when you display it. That is why it is black. I dont have it working yet but I think these resources are just the think to help.
Hope it helps.
I have a small multiview app. It consists of a UITabBarController with a nav controller in each tab. What I want is to show a UIImageView when a user shakes the device. After I've implemented the loading of the UIImageView, I faced a problem-the image was only 2/3 of the screen because of the tab and nav bars. I managed to hide the nav bar but I'm still stuck with the tab bar. I tried many solutions such as [tabBar setHidden: YES]; but I get errors "tabBar undeclared", although I've imported the AppDelegate, where the tabBar was defined.
Thanks in advance!
Try setting
myViewController.hidesBottomBarWhenPushed = YES;
when you create your UIImageView. When you push it on to the view stack the UITabBar will hide automatically, and it will be restored automatically when you pop or dismiss the controller. No need for the application delegate.
If you want to show a full screen view, it is best to use a modal view controller. This way you do have to worry about hiding/showing navigation items. Take a look at:
http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html
to get started.
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.