i trying create app can save strings of messages users, , displaying messages in uiview go inside uiscrollview. now, once these views created, have message id associated it. suppose tap link contains message id, want app redirect me specific location in scrollview when view of message located. knows that?
btw, used code assign message id's views:
- (void) getmessageid:(uiscrollview*) scrollview{ cgpoint point = cgpointmake( scrollview.contentoffset.x + 40, 20); ( uiview* childview in scrollview.subviews ) { if ( [childview iskindofclass:[uiview class]] ) { if(cgrectcontainspoint([childview frame], point)) { [[nsuserdefaults standarduserdefaults] setobject:[nsstring stringwithformat:@"%i" , childview.tag] forkey:@"current_message"]; } } } } since have multiple subviews inside scrollview (depending on number of messages), want start view in specific location of message (not load particular message alone)
can using [self.scrollview viewwithtag:messageid]?
do this. take 1 array message id's in same order scrollview subviews(displaying order of messages on scrollview) ,whenever click on link find position of message id in array , using message id can set contentoffset value scrollview.
Comments
Post a Comment