LazyScrollView icon indicating copy to clipboard operation
LazyScrollView copied to clipboard

LazyScrollView的subView起点坐标问题

Open angel-cry opened this issue 6 years ago • 0 comments

子视图的起点坐标为何不是从左上角开始算的?如下self.lazyScroll是LazyScrollView,因为设置过setTranslucent和edgesForExtendedLayout,它的起点坐标是从从导航栏左上角开始计算的,但是加在LazyScrollView上的子视图的起点坐标,为何不是从LazyScrollView的左上角开始计算的?

// view [self.view addSubview:self.lazyScroll];

// frame
[self.lazyScroll mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.left.right.mas_equalTo(self.view);
    make.bottom.mas_equalTo(self.view.mas_bottom);

}];

 // Here is frame array for subView.
 // LazyScrollView must know item view's frame before rending.
 CGFloat maxY = 0, currentY = 0 - APP_NavHeight;
 CGFloat viewWidth = CGRectGetWidth(self.view.bounds);
 [self addRect:CGRectMake(0, 0 + currentY, viewWidth , 200) andUpdateMaxY:&maxY];

angel-cry avatar Jun 01 '18 07:06 angel-cry