ios - animation hide/show only occurring once -
im trying animation on uipicker when app runs hidden , when button pressed appear sliding buttom , when tap button again slide away. well, code once. does:
first click -> show picker, ispickerhidden = no
second click -> hides picker, ispickerhidden = yes
third click -> not anything, returns ispickerhidden = no in viewdidload declaration are;
and same fourth click doesnt return correct bool value.
ispickerhidden = yes; [self.picker sethidden:ispickerhidden]; if(ispickerhidden == no){ [uiview beginanimations:nil context:nil]; [uiview setanimationduration:0.6]; cgrect frame = self.picker.frame; [self.picker setframe:cgrectoffset(frame, self.picker.frame.origin.x, self.picker.frame.origin.y)]; [uiview commitanimations]; ispickerhidden = yes; nslog(@"hidden yes"); }else if(ispickerhidden == yes) { [uiview beginanimations:nil context:nil]; [uiview setanimationduration:0.6]; cgaffinetransform transfrom = cgaffinetransformmaketranslation(0, -200); self.picker.transform = transfrom; [self.picker sethidden:no]; [uiview commitanimations]; nslog(@"hidden no "); ispickerhidden = no; }
i know on whats problem facing, , missing. thanx
add logging frame , picker see happening...
nslog(@"picker: %.0f, %.0f, %.0f, %.0f", self.picker.frame.origin.x, self.picker.frame.origin.y, self.picker.frame.size.width, self.picker.frame.size.height);
Comments
Post a Comment