objective c - IOS 8 ScrollView fixed content -


hi developing ios application. using scrollview. encountered problem on ios version 8. added in following way scroll content inside. scroll in first picture looks steady. other images scrolling.

nsarray *aimageurls = (nsarray *)[_datasource arraywithimageurlstrings];     if([aimageurls count] > 0)     {         [_scrollview setcontentsize:cgsizemake(_scrollview.frame.size.width * [aimageurls count],                                                _scrollview.frame.size.height)];          (int = 0; < [aimageurls count]; i++)         {             cgrect imageframe = cgrectmake(_scrollview.frame.size.width * i, 0, _scrollview.frame.size.width, _scrollview.frame.size.height);             uiimageview *imageview = [[uiimageview alloc] initwithframe:imageframe];             [imageview setbackgroundcolor:[uicolor clearcolor]];             [imageview setcontentmode:[_datasource contentmodeforimage:i]];             [imageview settag:i];             [imageview setimagewithurl:[nsurl urlwithstring:(nsstring *)[aimageurls objectatindex:i]]];              // add gesturerecognizer imageview             uitapgesturerecognizer *singletapgesturerecognizer = [[uitapgesturerecognizer alloc]                                                                   initwithtarget:self                                                                   action:@selector(imagetapped:)];             [singletapgesturerecognizer setnumberoftapsrequired:1];             [imageview addgesturerecognizer:singletapgesturerecognizer];             [imageview setuserinteractionenabled:yes];              [_scrollview addsubview:imageview];         }          [_countlabel settext:[nsstring stringwithformat:@"%lu", (unsigned long)[[_datasource arraywithimageurlstrings] count]]];         _pagecontrol.numberofpages = [(nsarray *)[_datasource arraywithimageurlstrings] count];         _pagecontrol.hidden = ([(nsarray *)[_datasource arraywithimageurlstrings] count] > 0?no:yes);     } 

first picture in scrollview enter image description here


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -