ios - Pushing a button in a Scrollview without UserInteraction on -
i using uitableview headers , footers, whole tableview has horizontal uiscrollviews inside. use lock titles function, in excel.
the userinteraction disabled on uiscrollview in uitableview header , uitableview footer , scrolls when body scrolls.
in header have button situated in uiscrollviews contentview , need able interact it, not... has come across in past?
much of unneeded code has been omitted...
- (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { uitableviewheaderfooterview *viewheader; uibutton *flow; viewheader = [[uitableviewheaderfooterview alloc] initwithframe:cgrectmake(0, 1, self.tableview.frame.size.width, 48)]; uiview *thiscontentview = [[uiview alloc]initwithframe:cgrectmake(0, 0, contentwidth, 48)]; flow = [[uibutton alloc] initwithframe:cgrectmake( flowrate.frame.origin.x + flowrate.frame.size.width + 5, 14, colwidth1, 20)]; [flow.imageview setimage:[uiimage imagenamed:@"ic_flow"]]; flow.imageview.contentmode = uiviewcontentmodescaleaspectfit; [flow setcontentmode:uiviewcontentmodescaleaspectfit]; [universalmethods tintimageviewinbutton:flow withcolor:bright_blue]; [flow addtarget:self action:@selector(showsortingalert:) forcontrolevents:uicontroleventtouchupinside]; [thiscontentview addsubview:flow]; [thisscrollview addsubview:thiscontentview]; thisscrollview.contentsize = thiscontentview.frame.size; thisscrollview.tag = scrolltag; [thisscrollview setuserinteractionenabled:false]; [viewheader addsubview:thisscrollview]; return viewheader; }
when userinteraction disabled on view, prevents touch events being passed down subviews. you'll need enable userinteraction on scrollview in order tap button. can set isscrollenabled false in order prevent scrollview scrolling.
Comments
Post a Comment