Objects Not Appearing In Simulator Correctly

Discussion in 'iOS Programming' started by ahan.tm, Aug 19, 2011.

  1. ahan.tm macrumors regular

    Joined:
    Jun 26, 2011
    Location:
    Florida
    #1
    Hi,

    I am trying to create a View-Based Application with Xcode 4 and when I run my project in the simulator, the objects(Mostly UIImageView) do not show correctly, they are all distorted and misplaced. I am using Interface Builder and setting the files under the Attributes Tab. Please also note, that the project uses the landscape orientation and PNG files.

    Any help would be appreciated!

    Thanks
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    Are they displaying properly on actual devices?
     
  3. Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
    #3
    When you are using Interface Builder to build the view, is the view in IB in landscape or portrait?
     
  4. ahan.tm thread starter macrumors regular

    Joined:
    Jun 26, 2011
    Location:
    Florida
    #4
    Hi,

    Thanks for your responses. On an actual device, they do not show up correctly. They show up exactly the same way as in the simulator. Also, in Interface Builder I have set the Orientation under Simulated Metrics to landscape.

    Thanks
     
  5. SDub90 macrumors 6502a

    Joined:
    Nov 9, 2009
    Location:
    Long Island
    #5
    Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5)

    Can you also post a screen shot of interface builder and what the simulator shows? (If you did already, I can't see them because I'm on the mobile site.)
     
  6. ahan.tm thread starter macrumors regular

    Joined:
    Jun 26, 2011
    Location:
    Florida
    #6
    Here is a picture in the simulator and in Interface Builder-

    Simulator: Simulator .png

    Interface Builder: IB.png
     
  7. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #7
    Interesting... what do you springs and struts look like in Interface builder for all the balls?

    Maybe try turning on all the struts and turning off all the springs?

    Edit: Springs and struts may be accessed by clicking on an object, clicking on the ruler tab on the right side column and looking at the white box below "Origin" and above "Autosizing". Turning on the struts means click on all the things that look like I beams so that they're all solid red. Turning off the springs means click on the double ended arrows so that they're red dashes. Just letting you know incase you don't understand the terms "springs" and "struts".
     
  8. ahan.tm thread starter macrumors regular

    Joined:
    Jun 26, 2011
    Location:
    Florida
    #8
    It Works!!!

    Thank you so much for your help. I fixed by playing around with the springs and struts!:)
     
  9. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #9
    I think this is the first time I've actually offered a bit of help that actually worked! :D
     
  10. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #10
    Not true, I saw an interesting piece of code you posted in another topic, but forgot to quote you there. Thanks ;p
     

Share This Page