I have a UIScrollView
that scrolls horizontally. I have about 10 views lined up horizontally in that scrollview. I want to find the view that contains the center point of the scrollview's frame (not contentView.frame) as it scrolls. I am thinking to use the - (void)scrollViewDidScroll:(UIScrollView *)scrollView
UIScrollView
delegate method, but I am not sure how to find this.
Thanks!
You can get the start-point of a frame of a view (
myChildView
) in the reference of another view (scrollView
) using the following code:Use the
scrollViewDidScroll:
delegate method to pick your views and perform the calculations there.