Natterings RSS

Mobile Hacker Stephen Ryner Jr. is also known as @nuthatch

Archive

Dec
28th
Mon
permalink

Use UIHardware

phonedev:

Don’t assume that the size of the screen is 320x480 (who’s to say that the next version of the iPhone won’t have a 480x640 screen?) Also the status bar can be more than 20 pixels high (like during a phone call.)

Do this:

CGRect contentRect = [UIHardware fullScreenApplicationContentRect];

UINavigationBar *navigationBar = [[[UINavigationBar alloc] initWithFrame:CGRectMake(contentRect.origin.x, contentRect.origin.y, contentRect.size.width, 44.0f)] autorelease];

UITextView *textView = [[[UITextView alloc] initWithFrame:CGRectMake(contentRect.origin.x, 44.0f, contentRect.size.width, contentRect.size.height - 44.0f)] autorelease];

  1. nuthatch reblogged this from phonedev
  2. phonedev posted this
blog comments powered by Disqus