我有两个视图,一个是aView,另一个是bView,aView上有一个按钮,我点击按钮,我会跳到bView,请看代码
-(IBAction)jump2b:(id)sender{
CATransition *animation = [CATransition animation];
animation.delegate = self;
animation.duration = 0.25f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
animation.type = kCATransitionPush;
animation.subtype = kCATransitionFromTop;
[bView.view.layer addAnimation:animation forKey:@"animation"];
}
Run Code Online (Sandbox Code Playgroud)
它不能很好地工作,它可以跳,所以我该怎么办?谢谢
我在视图上创建一个UIButton,我想让touchesMoved只控制UIButton,而不是整个视图
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint touchMoved = [touch locationInView:self.view];
}
Run Code Online (Sandbox Code Playgroud)
如果我触摸UIButton,我想这样做,然后可以用我的手指移动UIButton,如果我触摸其他视图并且我的手指在屏幕上移动,则UIButton什么都不做.这意味着函数touchesMoved只具有UIButton的作用,那么我该怎么做呢?谢谢