Your SlideShare is downloading. ×
CocoaHeads Rennes #4 : la rotation sur iOS
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

CocoaHeads Rennes #4 : la rotation sur iOS

790
views

Published on

Published in: Technology, Business, Real Estate

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
790
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CocoaHeads Rennes 13 octobre 2011 Thomas Dupont La r tation sur iOS
  • 2. Comment supporter les orientations ?
  • 3. Project
  • 4. UIViewController- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation{ return UIInterfaceOrientationIsLandscape(orientation);}
  • 5. Comment gérer la rotation ?
  • 6. UIView @property (nonatomic) UIViewAutoresizing autoresizingMaskenum { UIViewAutoresizingNone, UIViewAutoresizingFlexibleLeftMargin, UIViewAutoresizingFlexibleWidth, UIViewAutoresizingFlexibleRightMargin, UIViewAutoresizingFlexibleTopMargin, UIViewAutoresizingFlexibleHeight, UIViewAutoresizingFlexibleBottomMargin};
  • 7. UIViewAutoresizing[myView setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin| UIViewAutoresizingFlexibleTopMargin| UIViewAutoresizingFlexibleRightMargin| UIViewAutoresizingFlexibleBottomMargin)];
  • 8. UIViewAutoresizing[myView setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin| UIViewAutoresizingFlexibleBottomMargin)];
  • 9. UIViewAutoresizing[myView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleTopMargin| UIViewAutoresizingFlexibleBottomMargin)];
  • 10. UIViewController- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration - (void)didRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration
  • 11. Comment être prévenu des rotations ?
  • 12. UIWindow makeKeyAndVisibleUIWindowLevelNormal UIWindowLevelAlertUIWindowLevelStatusBar
  • 13. UIViewControllerUIWindow UIView UIViewController UIView UIViewController @property (nonatomic, retain) UIViewController *rootViewController
  • 14. Démo
  • 15. Comment gérer manuellement la rotation d’une UIView ?
  • 16. connaître l’orientation @property (nonatomic) UIInterfaceOrientation statusBarOrientation @property (nonatomic, readonly) UIDeviceOrientation orientationtypedef enum { UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight, UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft} UIInterfaceOrientation;typedef enum { UIDeviceOrientationUnknown, UIDeviceOrientationPortrait, UIDeviceOrientationPortraitUpsideDown, UIDeviceOrientationLandscapeLeft, UIDeviceOrientationLandscapeRight, UIDeviceOrientationFaceUp, UIDeviceOrientationFaceDown} UIDeviceOrientation;
  • 17. UIWindow width(0, 0) height
  • 18. UIWindow heightwidth (0, 0)
  • 19. changement d’orientationUIApplicationWillChangeStatusBarOrientationNotificationUIApplicationDidChangeStatusBarOrientationNotification statusBarOrientationAnimationDuration
  • 20. Démo
  • 21. Merci

×