-(BOOL) prefersstatusbarhidden{
return YES;
}//Hide Bar
2: Make the keyboard disappear
[_lastfield Resignfirstresponder];
[Self.view endediting:yes];//gzz0223
//
gzz0223 Keyboard Disappears
Nsarray *subviews = [Self.view subviews];
For (ID objinput in subviews) {
if ([Objinput Iskindofclass:[uitextfield class]]) {
Uitextfield *thetextfield = objinput;
if ([Objinput Isfirstresponder]) {
[Thetextfield Resignfirstresponder];
// }
// }
// }
[[[uiapplication sharedapplication] keywindow] endediting:YES];
// monitor keyboard appears
[[nsnotificationcenter defaultcenter] addobserver:self selector:@ Selector(keyboardwillshow:) name:uikeyboardwillshownotification object:nil];
// monitor keyboard disappears
[[nsnotificationcenter defaultcenter] addobserver:self selector:@ Selector(keyboardwillhide:) name:uikeyboardwillhidenotification object:nil];
}
keyboard appears , move Chatview up
-(void) Keyboardwillshow: (nsnotification*) noti{
// Get the height of the keyboard
cgsize size = [Noti. UserInfo[uikeyboardframeenduserinfokey] cgrectvalue]. Size;
// screen width high
cgsize winsize = self. View. Frame. Size;
size of the //tableview
_tableview. Frame = cgrectmake(0, 0, winsize. Width, winsize. Height - - -size. Height);
location of the //chatview
_chatview. Frame = cgrectmake(0, winsize. Height - - -size. Height, winsize. Width, (+ );
}
keyboard disappears, restores Chatview to its original position
-(void) Keyboardwillhide: (nsnotification*) noti{
// screen width high
cgsize winsize = self. View. Frame. Size;
size Recovery of //tableview
_tableview. Frame = cgrectmake(0, 0, winsize. Width, winsize. Height - +);
location Recovery of //chatview
_chatview. Frame = cgrectmake(0, winsize. Height - winsize. Width, (+ );
}
2016-02-22 listening keyboard hidden bar