输入附件视图在屏幕的底部显示,如果有附加硬件键盘(否则他们连接到屏幕键盘的顶部)。
设置你的输入视图的附属视图大小CGRectZero
的空UIView
。您将收到显示/隐藏通知这两种情况下,并能够从metrics in the notification's userinfo dictionary确定可用的屏幕尺寸。
UIView *inputAccessoryView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
inputAccessoryView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
textView.inputAccessoryView = inputAccessoryView;
…
- (void)keyboardWillShow:(NSNotification*)aNotification {
NSLog(@"%@", [aNotification userInfo]);
}
登录指标 - 注意框架UIKeyboardFrameEndUserInfoKey
是关闭屏幕
// (NSDictionary *) {
// UIKeyboardAnimationCurveUserInfoKey = 0;
// UIKeyboardAnimationDurationUserInfoKey = "0.25";
// UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {768, 264}}";
// UIKeyboardCenterBeginUserInfoKey = "NSPoint: {384, 891}";
// UIKeyboardCenterEndUserInfoKey = "NSPoint: {384, 1155}";
// UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 758}, {768, 264}}";
// UIKeyboardFrameChangedByUserInteraction = 0;
// UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 1022}, {768, 264}}";
// }
更新 - 非常相似,user721239's answer中的相关问题。
尼斯黑客,几乎是一个欺骗的的确是另一个问题,但并没有在我的搜索中显示。谢谢! – epologee 2012-11-08 11:15:12