Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Do what Matt did here, but just change the values and direction. I have code at home to do this from the bottom if you need it later (I'll update this post).</p> <p>Link: <a href="http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html" rel="nofollow noreferrer">http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html</a></p> <p>Also, don't forget to take out the bit of code that shifts the main view downward (so instead the UIView just pops over top like an ActionSheet)</p> <p><strong>Updated with code:</strong></p> <p>This is what I use in one of my apps to show/hide a little "options" view:</p> <pre><code>- (void)toggleOptions:(BOOL)ViewHidden { // this method opens/closes the player options view (which sets repeat interval, repeat &amp; delay on/off) if (ViewHidden == NO) { // delay and move view out of superview CGRect optionsFrame = optionsController.view.frame; [UIView beginAnimations:nil context:nil]; optionsFrame.origin.y += optionsFrame.size.height; optionsController.view.frame = optionsFrame; [UIView commitAnimations]; [optionsController.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.5]; [optionsController performSelector:@selector(release) withObject:nil afterDelay:0.5]; optionsController = nil; } else { optionsController = [[PlayOptionsViewController alloc] init]; // // Position the options at bottom of screen // CGRect optionsFrame = optionsController.view.frame; optionsFrame.origin.x = 0; optionsFrame.size.width = 320; optionsFrame.origin.y = 423; // // For the animation, move the view up by its own height. // optionsFrame.origin.y += optionsFrame.size.height; optionsController.view.frame = optionsFrame; [window addSubview:optionsController.view]; [UIView beginAnimations:nil context:nil]; optionsFrame.origin.y -= optionsFrame.size.height; optionsController.view.frame = optionsFrame; [UIView commitAnimations]; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload