* contentSize: The size of the content view. 其實(shí)就是scrollview可以滾動(dòng)的區(qū)域镊绪,表示內(nèi)容視圖,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960)洒忧,代表你的scrollview可以上下滾動(dòng)蝴韭,滾動(dòng)區(qū)域?yàn)閒rame大小的兩倍。
* contentOffset:The point at which the origin of the content view is offset from the origin of the scroll view. 是scrollview當(dāng)前顯示區(qū)域頂點(diǎn)相對于frame頂點(diǎn)的偏移量熙侍,比如上個(gè)例子你拉到最下面榄鉴,contentoffset就是(0 ,480),也就是y偏移了480
* contentInset:The distance that the content view is inset from the enclosing scroll view.是scrollview的contentview的頂點(diǎn)相對于scrollview的位置核行,例如你的contentInset = (0 ,100)牢硅,那么你的contentview就是從scrollview的(0 ,100)開始顯示
//上拉加載更多
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
[_refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView];
float offset=scrollView.contentOffset.y;
float contentHeight=scrollView.contentSize.height;
float sub=contentHeight-offset;
if ((scrollView.height-sub)>20) {//如果上拉距離超過20p蹬耘,則加載更多數(shù)據(jù)
//[self loadMoreData];//此處在view底部加載更多數(shù)據(jù)
}
}