ユーザーがiPadを横向きモードで保持している場合、キーボードのフレームオフセットを決定しています。横向きモードでコンテンツを追加してからiPadを表面に平らに設定すると、オフセットを適切に設定できないことがわかりました。以下のコードを使用してオフセットを設定しています。
if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft || [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight) {
tableView.frame = CGRectMake(0,0,tableView.frame.size.width, tableView.frame.size.height-keyboardsize.height);
}
私がチェックできるUIDeviceOrientationsは次のとおりです。
typedef enum {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait,
UIDeviceOrientationPortraitUpsideDown,
UIDeviceOrientationLandscapeLeft,
UIDeviceOrientationLandscapeRight,
UIDeviceOrientationFaceUp,
UIDeviceOrientationFaceDown
} UIDeviceOrientation;
(ソース:http ://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html )
ユーザーがアプリを横向き(UIDeviceOrientationLandscapeLeft
またはUIDeviceOrientationLandscapeRight
)に持っているかどうかを確認/確認してから、デバイスを下に置く(そうする必要がありますUIDeviceOrientationFaceUp
)方法はありますか?