我有一個問題,當設備方向朝上,將用戶信息從UIKeyboardWillShowNotification觀察者不給我良好的價值觀......的iOS UIKeyboardWillShowNotification USERINFO時面朝上/面朝下
//WHEN FACEUP -> Wrong Values
Keyboard will show: {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 0}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 568}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 568}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{inf, inf}, {0, 0}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{inf, inf}, {0, 0}}";
}
//WHEN PORTRAIR -> good values
Keyboard will show: {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 676}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 216}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
}
編輯更多信息:
我使用一個UINavigationController,這supportedInterfaceOrientations返回0 我需要它返回0,因爲我手動旋轉視圖,如果我用UIInterfaceOrientationX的視圖旋轉不能正常工作......
編輯2:
,我指的方向是沒有界面的方向,但該設備的方向。
EDIT(你拿着你的手機的方式)3:
這隻有當我推新視圖控制器,而面朝上,如果我把它,而波泰特,它的工作原理髮生...... 和重要的事情知道:當錯誤發生時,鍵盤不會顯示
編輯4:
我已經找到一種方法來修復錯誤,但會最有可能被蘋果拒絕:
objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationPortrait);
我還在尋找,不會被蘋果拒絕
您的意思是面朝上還是風景? –
faceup ...在風景中更多的一切工作正常,就像在portait。 – TheSquad