Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LazyScrollView的subView起点坐标问题 #17

Open
angel-cry opened this issue Jun 1, 2018 · 0 comments
Open

LazyScrollView的subView起点坐标问题 #17

angel-cry opened this issue Jun 1, 2018 · 0 comments

Comments

@angel-cry
Copy link

子视图的起点坐标为何不是从左上角开始算的?如下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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant