Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xnakx

macrumors newbie
Original poster
Oct 5, 2008
17
0
I have a UIScrollView with 5 UIImageViews (with unique tags) as subviews
how do i get the tag of the UIImageView that is currently displayed?
I am trying to update a UILabel's text to something like "Image x out of 5". from within scrollViewDidScroll

Jason
 
found it.
someone else pointed me to
Code:
CGFloat pageWidth = scrollView.frame.size.width;
    int page = floor((scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
label.text=text = [NSString stringWithFormat:@"Image: %d",page];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.