I am trying to hide the navigational bars according to the cursor positons.so, that i can use the full screen of the iPhone.But i donno how to start it.Please help me.
views:
37answers:
2Use the below code if you want to hide and unhide the navigation bar on double tap on any part of the view
in .h file
IBoulet UINavigationController *navigationController;
connect IBoulet in in XIB
in .m file
-(void)viewDidLoad {
[super viewDidLoad];
[navigationController setNavigationBarHidden:YES];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject];
if (touch.tapCount == 2) {
[navigationController setNavigationBarHidden:NO];
[NSTimer scheduledTimerWithTimeInterval:(1.0) target:self selector:@selector(hideBar) userInfo:nil repeats:NO];
}
}
-(void)hidebar{
[navigationController setNavigationBarHidden:YES];
}
Do the modifications as per your requirement.
hAPPY cODING...
There is no cursor on iPhone, but do you mean that you want to do something like safari - hide the address bar when scroll down more than one screen page?
Assume that you are using UITableView, I have a solution that: 1. we are already know height of each table row -> cell.frame.size.heigh 2. and we already know height of screen -> view.bounds.size.height 3. UITableView call cellForRowAtIndexPath every time it generate a cell So you can easily know how many cells are there in you table, row index and total height of them, whenever you see a row index which belong to next screen page, you should hide navigation bar with an animation. otherwise, if all row index are belong to 1st screen -> show navigation bar with animation.