Keyboard 和 customview 并不在同一坐标系,在presentViewController的view中弹出popview的话,customViewMaxY计算不对,可以这样修改:
在- (void)keyboardWillShow:(NSNotification *)notification这个方法中修改:
CGFloat customViewMaxY = self.customView.pv_Bottom + self.avoidKeyboardSpace;
改成:
CGRect cf = [self.customView convertRect:self.customView.bounds toView:[UIApplication sharedApplication].keyWindow];
CGFloat customViewMaxY = cf.origin.y + cf.size.height + self.avoidKeyboardSpace;