PS: _headView要成为textview的子view

     [textview addsubview:_headview];

有时候我们需要在UITextView的上面插入视图的样式,并且要求其随着输入一起滑动,这时候没有必要再加一个UIScrollView了,可以直接设置UITextView的一个属性,设置如下:

_headerView = [[UIView alloc] initWithFrame:CGRectMake(0,-88,self.view.frame.size.width,88)];
_textView.textContainerInset = UIEdgeInsetsMake(CGRectGetHeight(_headerView.frame), 0, 0, 0);

如果是UIScrollView、UITableView,可以使用contentInset属性