Scrollview rotating. I would really appreciate some insight or advice.

Discussion in 'iOS Programming' started by olsonvox, Jun 16, 2010.

  1. olsonvox macrumors newbie

    Joined:
    Jun 16, 2010
    #1
    So I have been working on this for several days, maybe even a week. My project is based on the Apple example "ScrollViewSuite".

    I have converted it to run on iPad and support rotation.

    The rotation and scaling works well when I go from Portrait to Landscape. 1st image is when an image is selected for display in portrait, then after I rotate to landscape it scales just fine and is centered.

    [​IMG]

    However, when I select a new image from the Thumbnail picker... it shifts over to the left of the screen...

    thumbnail
    [​IMG]

    [​IMG]

    then the other issue is that when I rotate back to portrait view the image does not scale to the size of the view. I get this....

    [​IMG]


    I really want to figure this out. I would totally appreciate any help you can provide to me.

    I have pasted the RootViewController.m file to pastie....

    RootViewController.m

    I have literally tried everything I can think of. Mainly been trying to use autosizingMask and various contentMode settings. I even put in a support request to Apple using one of my support requests. Their response was not very helpful. They just told me to use autosizingMask which I have been doing with every possible variation I can.


    I would really appreciate it is you could take a look at this code and give me another set of eyes some ideas or suggestsions or code examples you think might help.

    Thanks,

    Dan
     
  2. PatrickCocoa macrumors 6502a

    Joined:
    Dec 2, 2008
    #2
    Nothing obvious to me . . .

    Can you get the rotation to work on a significantly dumbed-down version of your app? Say something with only static images. Once that works, add in the various other elements until rotation stops working.
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    If you want the image to scale you may need to set the contentMode. Use one of the scaleToSomething modes.
     

Share This Page