PS: _headView要成为textview的子view
[textview addsubview:_headview];
有时候我们需要在UITextView的上面插入视图的样式,并且要求其随着输入一起滑动,这时候没有必要再加一个UIScrollView了,可以直接设置UITextView的一个属性,设置如下:
- 1
- 1
- 1
- 2
- 1
- 2
如果是UIScrollView、UITableView,可以使用contentInset属性
PS: _headView要成为textview的子view
[textview addsubview:_headview];
有时候我们需要在UITextView的上面插入视图的样式,并且要求其随着输入一起滑动,这时候没有必要再加一个UIScrollView了,可以直接设置UITextView的一个属性,设置如下:
如果是UIScrollView、UITableView,可以使用contentInset属性