视图在窗口之前拦截触摸

时间:2012-10-11 07:37:35

标签: ios animation touch

您好我的应用程序我模拟幻灯片视图并使用此代码

    [UIView beginAnimations: nil context:nil];
    [UIView setAnimationDuration: 0.5];
    [UIView commitAnimations]; 

不幸的是,新视图在窗口占用之前拦截触摸:如果我进行双击,则第二次点击工作新视图 我检查这个视图的框架它等于窗口框架

如果我关闭动画,它的工作正确。但我需要动画效果

请帮我找到正确的决定)

1 个答案:

答案 0 :(得分:0)

尝试使用块来生成UIView动画。最初禁用新视图上的触摸。然后动画并在完成块中启用触摸。

//disable touch on the slide view
[UIView animateWithDuration:0.5
                         animations:^{
                            //.. animate here
                         }
                         completion:^(BOOL finished){ 
                            //enable touch on the new view
                         }]
相关问题