画像を表示するフルスクリーンの UIScrollView があります。これは、Apple サンプル コードの PhotoScroller.app のコードをいくつか使用しています。回転を伴う scrollView 内の imageView と convertPoint の境界について少し混乱しています。どんな助けでも大歓迎です!
ps。詳細コードについては、境界の中心を参照してください。
NSLog の呼び出し willRotateToInterfaceOrientation:duration:
2012-05-12 11:35:45.666 imageScrollView frame X and Y are 0.000000 and 0.000000
2012-05-12 11:35:45.672 imageScrollView frame Width and Height are 320.000000 and 480.000000
2012-05-12 11:35:45.677 imageScrollView bounds origin X and Y are 0.000000 and 0.000000
2012-05-12 11:35:45.682 imageScrollView bounds Width and Height are 320.000000 and 480.000000
2012-05-12 11:35:45.686 imageView frame origin X and Y are 0.000005 and 0.374437
2012-05-12 11:35:45.689 imageView frame size Width and Height are 320.000000 and 479.251129
2012-05-12 11:35:45.693 imageView bounds origin X and Y are 0.000000 and 0.000000
2012-05-12 11:35:45.697 imageView bounds size Width and Height are 641.000000 and 959.999939
2012-05-12 11:35:45.701 boundsCenter X and Y are 160.000000 and 240.000000
2012-05-12 11:35:45.705 convertPoint origin X and Y are 320.500000 and 479.999969
NSLog の呼び出し willAnimateRotationToInterfaceOrientation:duration:
2012-05-12 11:36:05.975 imageScrollView frame X and Y are 0.000000 and 0.000000
2012-05-12 11:36:05.978 imageScrollView frame Width and Height are 480.000000 and 320.000000
2012-05-12 11:36:05.983 imageScrollView bounds origin X and Y are 0.000000 and 0.000000
2012-05-12 11:36:05.987 imageScrollView bounds Width and Height are 480.000000 and 320.000000
2012-05-12 11:36:05.990 imageView frame origin X and Y are 80.000008 and 0.000017
//I am confused here. Why is the X is 80.000008, and Y is 0.000017, but not (80, -120)?
2012-05-12 11:36:05.994 imageView frame size Width and Height are 320.000000 and 479.251099
2012-05-12 11:36:06.002 imageView bounds origin X and Y are 0.000000 and 0.000000
2012-05-12 11:36:06.006 imageView bounds size Width and Height are 641.000000 and 959.999878
2012-05-12 11:36:06.009 boundsCenter X and Y are 240.000000 and 160.000000
2012-05-12 11:36:06.014 convertPoint origin X and Y are 320.500000 and 320.499969
自動サイズ変更設定について:
actionSheetCoverView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
imageScrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
imageView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
回転前のイメージビュー フレームの原点 (willRotateToInterfaceOrientation:duration の NSLog) は (0, 0) であり、回転後 (willAnimateRotationToInterfaceOrientation:duration:duration の NSLog:) は (80, -120) である必要があると思います。しかし、それは (80.000008, 0.000017) です。