0
你好,我想知道如何識別觸摸和兩個快速觸摸[Xcode中,iPhone]兩個快速觸摸
你好,我想知道如何識別觸摸和兩個快速觸摸[Xcode中,iPhone]兩個快速觸摸
嘗試按鈕以下操作添加到您的按鈕
UIControlEventTouchDownRepeat
例
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(100.0, 100.0, 80.0, 50.0);
[button setTitle:@"Tap Me!" forState:UIControlStateNormal];
[button addTarget:self action:@selector(touchDownRepeat:) forControlEvents:UIControlEventTouchDownRepeat];
[self.view addSubview:button];
這聽起來hackish的,但你可以子類的UIButton並重寫日e觸摸事件,並且如果[觸摸tapCount] == 2,你會發生什麼。
不要開始扔東西!我知道這不是優雅。