Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

olsonvox

macrumors newbie
Original poster
Jun 16, 2010
1
0
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.

landscape-good.png


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

thumbnail
thumbnailchooser.png


afterseclected.png


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....

rotatebacktoportarit.png



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
 
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.
 
If you want the image to scale you may need to set the contentMode. Use one of the scaleToSomething modes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.