Here, the method of TableView is used to move the whole.
Code: (where 60 is the height of the cell)
//Click on the input box to trigger- (void) Textfielddidbeginediting: (Uitextfield *) textfield{//Keyboard HeightCGFloat keyboardheight =216.0f; //Get TagNSLog (@"Hhhhh = = =%d", Textfield.tag); //determine if the height of the keyboard is obscured by the input box, more than how much distance, moving how much distance (you can do it well, not necessarily the same as here) if(Self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) <0&&self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) >- -) {[Self.tableviews Setcontentoffset:cgpointmake (0, -) Animated:yes]; } Else if(Self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) <- -&&self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) >- -) {[Self.tableviews Setcontentoffset:cgpointmake (0, the) Animated:yes]; } Else if(Self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) <- -&&self.tableviews.bounds.size.height-keyboardheight- -* (Textfield.tag +1) >- the) {[Self.tableviews Setcontentoffset:cgpointmake (0, the) Animated:yes]; }}//keyboard Retract trigger- (void) Textfielddidendediting: (Uitextfield *) textfield{//return to the same place[Self.tableviews Setcontentoffset:cgpointmake (0,0) Animated:yes];}
IOS about TableView There are multiple TextField, the input box is obscured by the workaround