IPad status bar covers up my app's top  UIViews; okay after rotation

I wrote an iPad app. When it is first started up (in iPhone simulator, or on real iPad) all the UIViews at the top of my window are partially covered-up by the iPads time/battery status bar.
After I rotate the iPad (simulator or real one) the problem goes away: my UIViews appear shifted down, so they are under (below) the status bar. In other words, after I do the first rotation, the iPad knows to push my window downwards about 20 pixels to make room for the status bar. But before the first rotation (simulator or hardware) the iPad is not shifting my UIViews downward.
Question: What can I do in software (during the startup logic) to get the iPad to push my window down to make room for the status bar?
I think the iPad should do it automatically for me, but since it is not, I'm willing to take some action in the software to get it to happen. Any thoughts? NOTE: When I create all my UIViews, I'm using a coordinate of (0,0) for my upper left corner, which is correct, and after the first rotation everything works great. Also: I have auto-rotation enabled, so my app is always rotating to keep its display "up" so users can view it in all 4 rotations.

Hi David -
David Restler wrote:
Question: What can I do in software (during the startup logic) to get the iPad to push my window down to make room for the status bar?
If you're creating the view in your code, you're explicitly setting the view frame. The controller then assumes you know what you're doing and doesn't make any adjustment for the status bar (or any other bars that may be above or below the content area).
In other words, when you explicitly set the frame in loadView, you're buying sole responsibility for the starting dimensions. In the case of an iPad with only the status bar, you need to drop the y-origin down 20, and shorten the height by 20:
- (void)loadView {
CGRect frame = CGRectMake(0, 20, 768, 1004);
UIView *v = [[UIView alloc] initWithFrame:frame];
self.view = v;
[v release];
NSLog(@"%s: self.view=%@ self.view.frame=%@",
_func_, self.view, NSStringFromCGRect(self.view.frame));
Btw, if you ever open your IB, try adding and subtracting the various simulated bars while watching the dimensions of the view in the Size Inspector. If the view is the main content view (i.e. connected to the 'view' outlet of File's Owner), you should see the y-origin and size adjust for each combination of bars. In fact, those dimensions will probably be grayed out, since IB doesn't trust us with such critical numbers. The point is, that when a view is loaded from a nib built with the correct simulated bars, the adjustment for the bars has already been saved in that file.
I think the iPad should do it automatically for me
If you want to see what the controller does by default (i.e. no nib and no frame defined in loadView), try this code:
// MyAppDelegate.m
#import "MyAppDelegate.h"
#import "MyViewController.h"
@implementation MyAppDelegate
@synthesize window, viewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
MyViewController *vc = [[MyViewController alloc] initWithNibName:nil bundle:nil];
vc.view.backgroundColor = [UIColor grayColor];
self.viewController = vc;
[vc release];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
NSLog(@"%s: viewController.view.frame=%@",
_func_, NSStringFromCGRect(viewController.view.frame));
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
@end
// MyViewController.m
#import "MyViewController.h"
@implementation MyViewController
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
@end
When no nib name is specified, and the view loader can't find a nib that matches the owner's class name, and loadView isn't overridden, the view controller creates a default view (see no. 3 under "The steps that occur during the load cycle are as follows:" in [Understanding the View Management Cycle|http://developer.apple.com/library/ios/featuredarticles/ViewControllerPGf oriPhoneOS/BasicViewControllers/BasicViewControllers.html#//apple_ref/doc/uid/TP 40007457-CH101-SW19] in the View Controller Programming Guide for iOS). If you run the above example code, you should see the frame of the default view takes all bars into account.
... I'm using a coordinate of (0,0) for my upper left corner, which is correct
As explained above, it's not correct if there are any upper bars
and after the first rotation everything works great.
Yes, all bets are off after an auto-rotation. The system recalculates the content view frame in that case (though that math doesn't always come out the way you want).
Hope that helps to unscramble things a little!
- Ray

Similar Messages

  • Status bar covering iPhone 6 view IOS 8

    have you experience the status bar covering the view specially in Facebook apps when opening a link then closing it. the status bar is blocking the X of the page,

    You can disconnect and re-connect and try again.  You should be selecting the Update button for the new Software.  The update while connected to iTunes should not take all that long from the download, through the Verification and then the Install.  If that down't work, you may have to Restore your iPhone to Factory Settings, insuring first you do have a current Backup available to Restore from Backup at a later time after the Restore as New.
    Sometimes you can Update your iOS software in a WiFi environment even faster,  if you have enough memory available for the process to work.

  • Status bar covers top of iPhone apps on iPad2/ mini

    Since iOS 7 came out I have had several iPhone apps that have the status bar visible and is on top of the app, hiding the top portion of the screen (in games, usually where scores are or number of lives left). Prior to iOS 7 the satus bar was hidden if I had the game in 2x mode, but with iOS 7 I can't even go back to 1x mode. Is their a fix for this or is it a bug that will hopefully get fixed in an update? I kept hoping each update would fix it but no such luck yet. Or is it an app issue?
    Most of them are older apps and does this both on my iPad 2 and iPad Mini.

    I just want to leave this picture here, showing how annoying the status bar is since the last update.
    i made this picture on my ipad mini playing the iphone game Zenonia the status bar hides half of the map (upper left corner) and the backpack button (upper right corner) making it impossible to play the game because that button is really important.
    i hope that this gets fixed someday.

  • Status bar disappears in iPhone apps running on iPad

    I would like to confirm whether this is considered a bug or not.
    Pick an iPhone app (for example, Foursquare) and open it using an iPad. You will notice that the status bar (the area that takes the whole app view width and that is 20pt high). Send it to background, then open the task switcher (sorry, I don't know its exact name). You will see that the preview image for that app has the status bar visible, however when you tap on it and the app is resumed you will also notice how it suddenly disappears.
    Please confirm whether this is happening to you. This annoys me a lot since I'm currently developing an iPhone app and I only have an iPad to test it, so what I am seeing is no longer exactly the same that is usually seen in an iPhone (well, a 3.5 inch iPhone). I'm using iOS 7.0.4

    Hi, I'd like to tell you a good news. This issue had been resolved by using a single line configuration in Info.plist file. After testing it does work fine for me.
    Try it:
              <key>UIViewControllerBasedStatusBarAppearance</key>
              <false/>

  • Where is status bar when running iphone app

    I've updated my iPad Mini to iOS 7 and now when I run iPhone apps I don't see the status bar (time and battery level etc).  It used to show in iOS 6.
    I see the status bar fine when running iPad apps, just not iPhone apps.
    Any ideas?

    I don't know which app your using but you can try deleting it and reinstalling it from the cloud. If it's in iPhone mode, you should see the 2x but when you switch it to 2x yes the option seems to disappear to go back to 1x when you are using IOS 7.
    I lost the 1x on one of my apps but when I removed and reinstalled, it was there again. The time was showing at the top when I reinstalled it again from the cloud.

  • IPad Status bar: is it ok to hide it?

    Hi, I'm designing a News app for the ipad and wondered if it is ok to hide the status bar?
    We're using a left right swipe to interact with the content and the amount of space on the screen is tight. Losing the status bar would help, but I'm not sure if it's bad practice.
    thanks

    iOS Application Programming Guide
    Introduces the development process for iOS applications and describes the core architecture.
    iOS Development Guide
    http://developer.apple.com/library/ios/navigation/
    Describes how to build, run, debug, and tune your applications on both the simulator and devices.
    iOS Human Interface Guidelines
    Provides user interface rules that must be followed to distribute an iPhone or iPad application.

  • Status Bar Disappears in Mail App

    Vonage sends me email attachments containing my voicemails in WAV (G.711) format. Although, G.711 encoded WAV's are very popular in telecom I understand they are not supported on the iPhone. I now convert these WAVs to MP3 and forward as an email attachment to the iPhone.
    When I try to play the WAV attachment from the email app, the status bar disappears (only when in the mail app).
    When I play the MP3 attachment from the mail app, the status bar no longer displays correctly (only when in the mail app).
    I must power off and power on my iPhone for the status bar to return when in the mail app. I've restored by iPhone multiple times and the problem still occurs.
    Email me, [email protected] and I'll forward the email containing the attachments.
    How can I fix this?

    This blog post discusses when support for MP3 and WAV email attachments was added by Apple. The supported was added in 1.1.1.
    http://www.boygeniusreport.com/2007/09/27/iphone-now-supports-mp3-and-wav-attach ments/
    The screen shot even shows what the email attachment looks like.
    It also appears that the status bar may have disappeared in that screen shot too.
    So, MP3 and WAV email attachments are supported.
    Message was edited by: Bog

  • Status Bar Unshackled in Netflix App

    In most, perhaps all other, apps, the 'status bar' at the top of the display (showing connection, signal, time, battery, etc) rotates along with the rest of the display as you switch between portrait and landscape. In my Netflix app that's not the case.
    Instead, they flip to the other orientation separately, sometimes with quite a delay before the other part follows along. In a few cases, I think all on changing to landscape mode, they never do catch up; the main display flips properly but the status bar stays in its original position, i.e., now on the right side of the screen.
    Another rotation usually serves to get things matched up again. Not a huge deal, but I'm wondering if anyone else has seen this and, if so, if there's anything to be done about it?

    This blog post discusses when support for MP3 and WAV email attachments was added by Apple. The supported was added in 1.1.1.
    http://www.boygeniusreport.com/2007/09/27/iphone-now-supports-mp3-and-wav-attach ments/
    The screen shot even shows what the email attachment looks like.
    It also appears that the status bar may have disappeared in that screen shot too.
    So, MP3 and WAV email attachments are supported.
    Message was edited by: Bog

  • Iphone 4 - IO6 Problem:  My apps are stuck on "loading" - no new apps will install.  Status bar is stuck, so apps will not install.  How to fix?

    Iphone 4 - IO6 Problem:  After upgrading to the absoulte crap that is IO6, one of my apps is stuck on "loading" and no new apps will install.  If I delete this "loding app" (which happens to be iMovie), the next app that tries to install gets stuck on "loading" and every other app gets stuck on "waiting."  How to fix??

    I had the same issue and tried several options like rebooting, resyncing, deleting and reinstalling apps, restarting the network connection but none of them worked. Eventually I opened iTunes on my iPhone (not on Mac) to find that it had two pending downloads that was stopping the rest of the apps from loading fully.  You need to cancel them by swiping left to right over the listed apps and select cancel/delete. It worked for me.  Good luck!

  • How do I remove the status bar from iPhone apps on the iPad?

    Whenever I go onto an iPhone app on my ipad I have recently had the status bar covering up some of my game. Here is an example: http://i.imgur.com/Q9xnYhT.jpg
    As you can see the score is hidden, I have gone through the settings and can't find anything,please help! It only started doing it when I reset my settings and updated to 7.1.

    Same problem...seems that this is for apps that are for iPhone and/or for both...but not for ones made just for iPad!
    Used to be able to click the 2X and the app would go full screen...not anymore...Apple you need to fix this!!!

  • My iPad 2 status bar has intruded into my Mexican Train Dominos game with iOS 7. Is there a fix?

    My iPad 2 status bar has intruded into my Mexican Train Dominos game with iOS 7. The status bar covers the top 10% of the screen with this game only.  Did not do this with iOS 6! Is there a fix?

    Try some basic troubleshooting:
    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings

  • There's a huge blank white screen below the status bar, that covers half of the screen in 3.6

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    When I opened Firefox there is a big blank screen below the status bar covering up half of the screen. It only happens on 3.6 version of Firefox
    == This happened
    ==
    Every time Firefox opened
    == Few Days Ago
    ==
    == Troubleshooting information
    ==
    Application Basics
    Name Firefox
    Version 3.6.7
    Profile Directory
    Open Containing Folder
    Installed Plugins
    about:plugins
    Build Configuration
    about:buildconfig
    Extensions
    Name
    Version
    Enabled
    ID
    Stylish 1.0.9 true {46551EC9-40F0-4e47-8E18-8E5CF550CFB8}
    Cooliris 1.12.0.36949 true [email protected]
    FoxTab 1.3 true
    WOT 20100503 true
    ImTranslator 3.3.3 true {9AA46F4F-4DC7-4c06-97AF-5035170634FE}
    Are You Watching This?! 2.5 true [email protected]
    SearchPreview 4.6 true
    qtl 14.3 true [email protected]
    DVDVideoSoft Menu 1.0.1 true
    NEW Glasser by SzymekPL 2.2.0.3.7 true [email protected]
    foof 1.2.8 true [email protected]
    Java Console 6.0.20 true
    Full Screen Homestar Runner 2.9 true
    Flash Game Maximizer 1.3.6 true {258735dc-6743-4805-95fc-f95941fffdad}
    MultiMediaWebRecorder 0.397 true [email protected]
    Download Statusbar 0.9.7 true
    Extended Statusbar 1.5.4 true
    NoScript 1.10 false {73a6fe31-595d-460b-a920-fcc0f8843232}
    WebSitePulse Transaction Recorder 1.4 false [email protected]
    Smart Bookmarks Bar 1.4.3 true [email protected]
    Xmarks 3.7.8 true [email protected]
    Gmail Watcher 1.10 true gmailwatcher@sonthakit
    Yahoo! Mail Watcher 1.10 true yahoomailwatcher@sonthakit
    Dr.Web anti-virus link checker 1.0.21 true {6614d11d-d21d-b211-ae23-815234e1ebb5}
    FIFA Online Web Launcher 1.1 false [email protected]
    ReminderFox 1.9.8.2 false
    1-Click YouTube Video Downloader 1.4 true [email protected]
    OurWorld.com Toolbar 2.7.0.14 true {80f6f9bf-9fd1-4f41-9ddf-6dd070f4f62f}
    Yahoo! Toolbar 2.1.1.20091029021655 false {635abd67-4fe9-1b23-4f01-e679fa7484c1}
    Yoono 7.3.6 false
    Form History Control 1.2.6 true [email protected]
    Boost for Facebook 10.0.2 false {47624dda-b77e-4feb-820a-e4f077d5d4ca}
    Fireclam 0.6.5 false
    Viral Threat Level 0.54 false [email protected]
    Ghostery 2.2.1 true [email protected]
    FootieFox 2.1.10 false {9fb7d178-155a-4318-9173-1a8eaaea7fe4}
    Puzzle 0.4.3 true [email protected]
    Tab Mix Plus 0.3.8.4 true
    FastestFox 4.1.5 true [email protected]
    AniWeather 0.7.4 true {4176DFF4-4698-11DE-BEEB-45DA55D89593}
    Get Styles 1.0.22 true {6236BA26-C117-4007-928C-DE0716C7FA80}
    Usage Stat 1.0.2 true {6236BA26-C117-4007-928C-DE0716C7FA96}
    FBFan 1.0.1 true {6236BA26-C117-4007-928C-DE0716C7FA99}
    Better YouTube 0.4.3 true [email protected]
    Show my Password 2.0 true
    LastPass 1.69.1 true [email protected]
    Favicon Picker 3 0.5 true {446c03e0-2c35-11db-a98b-0800200c9a67}
    Glassy Urlbar 0.5.2 true tgrsc@glassyUrlbar
    RSS Ticker 3.2.2 true {1f91cde0-c040-11da-a94d-0800200c9a66}
    iMacros for Firefox 6.7.0.1 true {81BF1D23-5F17-408D-AC6B-BD6DF7CAF670}
    Amplify 3.0.0 true {8f5ce3f8-1735-4680-b15e-108f2f50e8ba}
    Tidy Favorites Online 6.23 true
    Modified Preferences
    Name
    Value
    accessibility.typeaheadfind true
    accessibility.typeaheadfind.flashBar 0
    browser.history_expire_days.mirror 180
    browser.link.open_newwindow.restriction 0
    browser.places.importBookmarksHTML false
    browser.places.smartBookmarksVersion 2
    browser.startup.homepage http://www.google.com/
    browser.startup.homepage_override.mstone rv:1.9.2.7
    browser.tabs.insertRelatedAfterCurrent false
    browser.tabs.warnOnClose false
    extensions.lastAppVersion 3.6.7
    keyword.URL http://search.conduit.com/ResultsExt.aspx?ctid=CT2383985&q=
    network.cookie.prefsMigrated true
    places.history.expiration.transient_current_max_pages 32166
    places.last_vacuum 1278789082
    privacy.clearOnShutdown.cookies false
    privacy.clearOnShutdown.downloads false
    privacy.clearOnShutdown.sessions false
    privacy.cpd.cookies false
    privacy.cpd.downloads false
    privacy.cpd.extensions-tabmix false
    privacy.cpd.history false
    privacy.cpd.sessions false
    privacy.sanitize.migrateFx3Prefs true
    privacy.sanitize.timeSpan 0
    security.warn_viewing_mixed false
    == Firefox version
    ==
    3.6.7
    == Operating system
    ==
    Windows 7
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7
    == Plugins installed
    ==
    *-Cooliris embedded in a tab
    *Office Plugin for Netscape Navigator
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.3"
    *Default Plug-in
    *Provides additional functionality on Facebook. See our web site for details.
    *Game Loader Plugin for Power Challenge Games
    *Unity Player 2.6.1f3
    *BrowserPlus -- Improve your browser! -- http://browserplus.yahoo.com/
    *Pando Web Plugin
    *Shockwave Flash 10.1 r53
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *GEPlugin
    *Yahoo Application State Plugin version 1.0.0.7
    *Google Update
    *Version 0.9.17, copyright 2008-2010 Veetle Inchttp://www.veetle.com/
    *Version 0.9.17, Copyright 2006-2009 Veetle Inchttp://www.veetle.com/
    *Version 0.9.17, copyright 2006-2010 Veetle Inchttp://www.veetle.com/
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers

    I have v. 3.6.8. It will display blank white pages at some site and not at others. I use safe mode and the access is reversed... what used to open doesn't and what didn't does. . .
    Is anyone trying to fix this problem - or are users just left to chasing their tails on this issue?
    Just curious ... in order to help me decide to wait for help or move on to something else...
    Until that time ... Earl J.

  • Is it me or is the ipad ios7 status bar smaller?

    I liked the ios6 clock on the ipad status bar, but now on ios7 its smaller and so is the signal icon. What can I do?

    The camera quality is not good. The iPad camera was really designed to use FaceTime in the device. Yes it is a camera and yes it will take photos. But the quality isn't so hot. You will find that the better the lighting, the better the quality of the photo. The camera on the new iPads is supposed to be a little better than previous versions, but like I said, the camera is intended to be used for FaceTime, the fact that the iPad takes photos is a bonus whether we see it that way or not. Actually, the video quality is pretty good, much better than the still photos.
    Personally, I would never use such an unwieldy device to take pictures anyway.

  • Status bar hidden on Mac

    My app has a regular window with status bar on. The app remembers the window size and position so when the user launches the app next time, the window will appear where it was. However, if the window was maximized last time, the newly launched window will be maximized but the status bar is  hidden.
    This happens under mac os x. The app can be found http://www.peaya.com/paper/download.html

    I just want to leave this picture here, showing how annoying the status bar is since the last update.
    i made this picture on my ipad mini playing the iphone game Zenonia the status bar hides half of the map (upper left corner) and the backpack button (upper right corner) making it impossible to play the game because that button is really important.
    i hope that this gets fixed someday.

  • Restored my Macbook Pro but my iTunes content was saved on a separate partition. When I re-setup iTunes the status bar reports 30gb less content than my iTunes Music folder. How can I find what is 'missing'?

    My Macbook Pro software was failing and the Apple Store was able to restore it without removing the partition on my hard drive that contained most of my files including all my iTunes content. Initially when I re-setup my library I simply went to file--> add to library. Shortly after I realized that was essentially copying the library to the other portion of the partition because I forgot to change the location of the library. So I deleted the content already copied & then I re-setup the library, by asking it to be pulled from the previous location using this pages advice: iTunes: How to open an alternate iTunes Library file or create a new one
    It appeared to work & everything I thought was imported. But on closer inspection, it appears that I have 30gbs less appearing on the status bar in the iTunes app than I do when I pull up the info on the iTunes Music folder in my finder. I'm not sure if this means somehow I have 30gbs of duplicates in my finder folder or if (most likely) I somehow didn't fully import the library from that file. Any advice? Is there a way to restore iTunes to factory settings again & set it up correctly this time?
    Also I never actually trashed the original content I accidentally transferred to the other drive but when i skimmed those in my trash bin it appears they ARE indeed in iTunes, so I have no clue what didn't actually import. Any ideas?! I'd greatly appreciate it!

    You could have all the computers point to the same library but it can't be opened by more than one at any time.
    No answer for knowing which library is in use other than selecting it at startup.  This question gets asked here occasionally but I don't think it is a high-demand feature since most people have just one library.  I guess you could put in an empty playlist with the library name so you have an identifier.

Maybe you are looking for