我想实现的效果就类似于微信或者手Q的聊天窗口,输入框在最底下,然后获得焦点时,软键盘弹出,但是此时聊天窗口的最顶上的内容还在,也就是聊天的窗口变成(手机屏幕-软键盘高度)。
思路或者demo代码或者github开源代码都OK
光阴似箭催人老,日月如移越少年。
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillAppear:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillDisappear:) name:UIKeyboardWillHideNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
然後設定UI的frame就可以了
難道你說的是 NavagationBar 如果你說的是這個那你的問題就好解決了,這個只要在一的視圖上加一個 NavagationController 作為rootController, 這個很簡單,但是仍需要學習一下
用通知監聽鍵盤的事件,在去更改的的view的frame就好了,就是2嘍的思路。
然後設定UI的frame就可以了
難道你說的是 NavagationBar
如果你說的是這個那你的問題就好解決了,這個只要在一的視圖上加一個 NavagationController 作為rootController, 這個很簡單,但是仍需要學習一下
用通知監聽鍵盤的事件,在去更改的的view的frame就好了,就是2嘍的思路。