iphone - iOS UIScrollView with 2 finger pan for paging and one finger pan for "fingerpointer" -
i spend quite time figure out how achieve want didn't find proper solution it, yet. have uiscrollview changed pangesturerecognizer 1 2 finger recognition paging works when 2 fingers used. want add additional pangesturerecognizer shows courser if i'm panning 1 finger. tried adding additional pangesturerecognizer uiscrollview app crashes immediately. thought of adding subview transparent , positioned above uiscrollview , delegate 2 finger gestures uiscrollview resgin firstresponder. thought of overwriting pangesturerecognizer of uiscrollview , let add subview "fingerpointer"(a little point centered i'm touching screen right now) located. i'm totally clueless way should go , how implement it. appreciated! lot!
timo
ok, second time editing response. might trick you.
if extend uiscrollview can override these methods in way:
//in h file bool cursorshown; //in m file -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { if([touches count] == 1) { cursorshown = yes; cgpoint touchlocation = [[touches anyobject] locationinview:self.superview] //add cursor parent view here , set location touchlocation } } -(void)touchesmoved:(nsset *)touches withevent:(uievent *)event { if(cursorshown == yes) { cgpoint touchlocation = [[touches anyobject] locationinview:self.superview] //move cursors location touchlocation } } -(void)touchesended:(nsset *)touches withevent:(uievent *)event { if(cursorshown == yes) { cursorshown = no; //destroy cursor } } -(void)touchescancelled:(nsset *)touches withevent:(uievent *)event { if(cursorshown == yes) { cursorshown = no; //destroy cursor } }
Comments
Post a Comment