uiscrollview - iOS: Storing Link to UIImageViews in Array, using them afterwards -
i make uiscrollview "page-able" , contains several kind of objects, including images, zoomable. set main uiscrollview , added on pages images additional uiscrollviews zoomable , contain subviews uiimages. while doing store link uiimageviews in array:
uiscrollview *imagescrollview = [[uiscrollview alloc] initwithframe:scrollviewimagerect]; [imagescrollview setminimumzoomscale:1.0]; [imagescrollview setmaximumzoomscale:2.0]; imagescrollview.delegate = self; uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(x, y, w, h)]; [imagelinkarray addobject:imageview]; [imagescrollview addsubview:imageview]; [self.scrollview addsubview:imagescrollview];
in viewforzoominginscrollview
can current page of main scrollview , return link:
- (uiview *)viewforzoominginscrollview:(uiscrollview *)scrollview { return [imagelinkarray objectatindex:page - 1]; }
works fine far, reset zoom scale whenever swipe page, else when swipe image still zoomed-in.
therefore i'm checking in -(void)scrollviewdidscroll:
if current page did change works fine, don't know how can reset zoom scale of uiimageview not declared in .h file , link have 1 in array. how can change properties of objects have kind of link?
okay, in meantime found answer question:
uiscrollview *changescrollview = (uiscrollview*)[imagescrolllinkarray objectatindex:i]; nslog(@"%@", changescrollview);
which opens imagescrollview made , stored in array before in order change it's values...
Comments
Post a Comment