Iphone/Ipod Screen dimensions

Discussion in 'iOS Development' started by Communati0n, May 22, 2010.

  1. Communati0n

    Communati0n New Member

    Joined:
    Oct 22, 2009
    Messages:
    824
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    Hi people

    I'm trying to make an app testing with the bouncing ball thing but the ball goes offscreen as i don't know what limits i should set

    anyone got ideas on what the iphone screen is in pixels, or do the screens differ?
  2. awal

    awal Well-Known Member

    Joined:
    Jan 2, 2008
    Messages:
    4,764
    Likes Received:
    31
    Device:
    iPhone 4S (White)
    320 X 480 px
  3. Communati0n

    Communati0n New Member

    Joined:
    Oct 22, 2009
    Messages:
    824
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    are u sure? i set the x and y limits to what you said but the bouncing ball still goes offscreen!?
  4. Freerunnering

    Freerunnering Member

    Joined:
    Sep 1, 2009
    Messages:
    296
    Likes Received:
    0
    Device:
    4G iPod touch
    x is the width (portrait) and 320px the height of thew size is 480px so the y.

    And yes we are sure those are the screen limits.

    Please Register or Log in to view images

  5. bddckr

    bddckr Active Member

    Joined:
    Dec 2, 2007
    Messages:
    1,434
    Likes Received:
    18
    Device:
    iPhone 4 (Black)
    Instead of hard coding these "magic numbers" use this:
    [OBJC]
    [UIScreen mainScreen].bounds.size.width
    [UIScreen mainScreen].bounds.size.height
    [/OBJC]
    But I'd prefer using the current view's size instead...
  6. Freerunnering

    Freerunnering Member

    Joined:
    Sep 1, 2009
    Messages:
    296
    Likes Received:
    0
    Device:
    4G iPod touch
    I think he's using DragonFireSDK though.

    Please Register or Log in to view images

  7. Communati0n

    Communati0n New Member

    Joined:
    Oct 22, 2009
    Messages:
    824
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    yeah that's right. i dunno if that works on dragonfiresdk. i need a fixed pixel width and so far, ive gone as low as actually testing out random values from 300 to 400 for width and still can't get it right.
  8. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    The iPhone's screen IS 320x480 (portrait mode). However, if the status bar is present, the actual space usable by your app drops down to 320x460.
    I'd really recommend you NOT hard-coding these values; with more and more iPhone OS devices, it becomes increasingly annoying. The iPad has a 768x1024 screen, and the next iPhone is rumored to have a 640x960 screen, 4 times the area of the current one.

    Are you sure that you can't even get the view's size from DragonFire?
  9. Communati0n

    Communati0n New Member

    Joined:
    Oct 22, 2009
    Messages:
    824
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    yeah i know what you mean and i personally dislike hardcoding these values, but i don't think there is a function on dragonfiresdk for this. i might actually just get a mac and try it there.
  10. bddckr

    bddckr Active Member

    Joined:
    Dec 2, 2007
    Messages:
    1,434
    Likes Received:
    18
    Device:
    iPhone 4 (Black)

Share This Page