2013-06-25 138 views
0

觸摸按鈕不會觸發暫停。我需要按住按鈕幾秒鐘才能將推送到另一個屏幕。觸摸按鈕不會觸發暫停

我使用故事板和IOS 5.

在IOS6的作品。

任何研究建議?

由於

編輯:

@implementation ViewController 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view, typically from a nib. 

    UITapGestureRecognizer *touchDismissKeyboard = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; 

    [self.view addGestureRecognizer:touchDismissKeyboard]; 

    [[self navigationController] setNavigationBarHidden:YES animated:NO]; 



} 

- (void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 

-(void)dismissKeyboard 
{ 


} 

下面的代碼行引起問題:

UITapGestureRecognizer *touchDismissKeyboard = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; 

    [self.view addGestureRecognizer:touchDismissKeyboard]; 

在IOS 6的作品,但在IOS5觸摸按鈕很長一段時間(4 -5秒)是必要的以觸發延續

+0

您需要發佈,當你按下一個按鈕,被調用的代碼。 – Geek

+0

UILongPressGestureRecognizer – adali

+0

您正在使用哪種類型的按鈕?你在使用手勢識別器嗎?請張貼一些代碼。 – KingPolygon

回答

0

以下代碼行導致t他的問題:

UITapGestureRecognizer *touchDismissKeyboard = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; 

[self.view addGestureRecognizer:touchDismissKeyboard];