UIScrollView的一些关系

contentInsets和contentoffset以及contentSize

可见范围: contentSize + contentInsets 也就是(contentSize.width+contentInsets.left+contentInsets.right,contentSize.height+contentInsets.top+contentInsets.bottom)

偏移量:要是UIScrollView中坐标为(x,y,w,h)的视图在左上角与UIScrollView左上角重合显示出来,那么contentoffset = frame - contentinsets

也就是(x - contentinsets.left,y - contentinsets.top)

猜你喜欢

转载自www.cnblogs.com/yuxiaoyiyou/p/9337299.html