ios - How to move to the next screen when the image drops onto when I tap the button? -
i wrote animation concept in viewdidload method wrote:
scalefactor=2; angle=180; cgrect frame = cgrectmake(10,10,45,45); uiview *box; box=[[uiview alloc] initwithframe:frame]; box.backgroundcolor=[uicolor colorwithpatternimage:[uiimage imagenamed:@"images673.png"]; [self.view addsubview:box];
// code touch event of object in screen // object movement wrote method shown below:
-(void)touchesended:(nsset *)touches withevent:(uievent *)event { uitouch *touch=[touches anyobject]; cgpoint location=[touch locationinview:self.view]; [uiview beginanimations:nil context:nil]; [uiview setanimationdelegate:self]; [uiciew setanimationduration:1]; [uiview setanimationcurve:uiviewanimationcurveeaseinout]; box.center=location; [uiview commitanimations]; }
// , then,now wrote button has navigate class file// general navigation principle wrote
-(ibaction)settings:(id)sender { ascreen *abc=[[ascreen alloc]init]; [self.navigationcontroller pushviewcontroller:abc animated:yes]; [abc release]; }
now object moving tap on screen,but when tap on button,the image not placing on top of button.what do.please me.i took image , made animation move till tap in screen. @ same time, took button , wrote button event action in viewcontroller. when tap button, image not moving onto button.
what want if tap button, image has drop onto button , should display next view controller. can me in doing so? how move next screen when image drops onto when tap button?
im not sure understand problem without seeing code cant this?
-(ibaction)buttonevent:(id)sender{ cgrect frame = image.frame; frame.origin.x = button.frame.x; frame.origin.y = button.frame.y; image.frame = frame; image.alpha = 0; [self pushviewcontroller:newviewcontroller animated:yes]; }
Comments
Post a Comment