Implement Auto Rotate in Auto Scroll sample source by xCode and Objective-C



SDK:    xCode 3.2
Device: iPhone 3GS

Case:      
      How to modify the sample source (2_Autoscroll) to let both UIView and the UIImage in the view rotate correctly while have iPhone rotate event?

Source:
      Please find the 2_Autoscroll source code in:
      http://developer.apple.com/iPhone/library/samplecode/ScrollViewSuite/Introduction/Intro.html

Trhanks.
agicfutureAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jacekmalinowskiCommented:
Well, you just have to add to the UIViewController this code:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
   return YES;
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agicfutureAuthor Commented:
Thanks. I added it and work. Thanks. However, seem need to set the uiscrollview and image width...etc as the Image width not match the rotated screen
0
jacekmalinowskiCommented:
You can set auto re-size mask to controls.
Sample code for UIImageView imgView:
[imgView setAutoresizingMask:(UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin)];

Open in new window

0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

agicfutureAuthor Commented:
Thanks. I will try it
0
agicfutureAuthor Commented:
Thanks. I will close this case.

Please kindly help on below question.

http://www.experts-exchange.com/Apple/Programming/Objective-C/Q_26023257.html
0
agicfutureAuthor Commented:
Thanks.  Please kindly help on below question too.

http://www.experts-exchange.com/Apple/Programming/Objective-C/Q_26023257.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.