i'm setting uicollectionviewcelllike this:
self.background = [[uiscrollview alloc]initwithframe:cgrectmake(0, 0, self.contentview.frame.size.width, self.contentview.frame.size.height)]; self.background.userinteractionenabled = yes; self.background.scrollenabled = yes; self.background.showsverticalscrollindicator = yes; // configure image self.image = [[uiimageview alloc] initwithframe:cgrectmake(0, 0, self.contentview.frame.size.width, self.background.frame.size.height)]; [self.background addsubview:self.image]; // configure title self.title = [[uilabel alloc] initwithframe:cgrectmake(5, 10, self.contentview.frame.size.width-10, 70)]; [self.background addsubview:self.title]; // configure description self.description = [[uilabel alloc] initwithframe:cgrectmake(5, 80, self.contentview.frame.size.width-10, 20)]; [self.background addsubview:self.description]; self.textview = [[uiwebview alloc] initwithframe:cgrectmake(0, self.image.frame.size.height+10, self.contentview.frame.size.width, 40)]; self.textview.delegate = self; nsstring *content = [nsstring stringwithformat:@"<html><head></head><body id='foo'>%@</body></html>", @"<p>kbafdj akdjfnadf jhadkfb ij daofhu adofh oj afoduuh oiad fohfd ouhadf dj aodfhj ah adlfk ohad ofladjhfl aojadf oadfh oadhf adfladf adfoadf oadfh aodfh oadf aodf afdjladf oad jladfl aodf alf d adjfladf adfj aldfkajdfljad aodfj adlfj ad aldjf adlfj al adfjadlfa d adf adf ad pajdf aldjf adkh pfbd fpqehf qehf qepd af pqif phhf q piiqihpsdhvpvqohro pdh wpvhqf lorem ipsum dfkbshbs k bfjsv ohfakdjb </p>"]; nsstring *path = [[nsbundle mainbundle] bundlepath]; nsurl *baseurl = [nsurl fileurlwithpath:path]; [_textview loadhtmlstring:content baseurl:baseurl]; [self.background addsubview:_textview]; [self addsubview:self.background]; [self sendsubviewtoback:self.background]; [self.background setcontentsize:cgsizemake(self.contentview.frame.size.width, 2*self.contentview.frame.size.height)]; the uicollectionview features fullscreen uicollectionviewcells scroll horizontally. there's uigesturerecognizeron uicollectionview:
self.pinchrecognizer = [[uipinchgesturerecognizer alloc] initwithtarget:self action:@selector(closecell:)]; self.pinchrecognizer.delegate = self; [_collectionview addgesturerecognizer:self.pinchrecognizer]; now, doesn't work uiscrollview. don't understand what's going wrong, if me out here, swell. doing wrong?
turns out problem was sending uiscrollview of uicollectionviewcell. removing [self sendsubviewtoback:self.background]; fixed problem.
Comments
Post a Comment