objective c - How to release or hide UIImageView in iOS? hidden is not working -
my purpose when drag object, small uiimageview
shows, when touch ended, uiimageview
released.
- (ibaction)tlmove:(uipangesturerecognizer *)sender { //add uiimage view show scaled dot uiimageview *scaleupview = [[uiimageview alloc] initwithframe:cgrectmake(200, 30, 100, 100)] ; scaleupview.layer.zposition = 300 ; [scaleupview setimage:self.originimage] ; [self.view addsubview:scaleupview] ; self.topleftpoint.center = [sender locationinview:self.topleftpoint.superview] ; targettl = self.topleftpoint.center ; if (sender.state == uigesturerecognizerstateended || sender.state == uigesturerecognizerstatecancelled || sender.state == uigesturerecognizerstatefailed) { [scaleupview sethidden:yes] ; // not working still shows [scaleupview removefromsuperview] ; //not working still shows } }
but not working @ all, tried scaleupview.hidden =yes
, still not working. scaleupview
show, want deallocated in arc mode, can't release when enabling reference counting.
u can set alpha = 0
. , u must check ure inside if statments.
so ure code might this:
if (sender.state == uigesturerecognizerstateended || sender.state == uigesturerecognizerstatecancelled || sender.state == uigesturerecognizerstatefailed) { nslog(@"inside if statement"); \\ [scaleupview setalpha:0] ; [scaleupview removefromsuperview] ; }
hope helps .
Comments
Post a Comment