0
我已經創建了工具欄,並在該工具欄中設置了UIBarbuttonItem。當我單擊欄按鈕時,我剛刪除了一個自定義視圖。我想避免多次觸摸酒吧按鈕項目,因爲有時用戶點擊多個酒吧按鈕項目(僅僅發生一段時間)。如何避免在iPhone中的酒吧按鈕項目多點觸摸?
這裏我的示例代碼,
UIBarButtonItem *closeBtn =[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(action)] autorelease];
toolBar.items = [NSArray arrayWithObjects:space,closeBtn,nil];
-(void) action
{
[customView removeFromSuperview];
}
所以我要避免多點觸摸,當點擊工具欄的欄按鈕。我怎麼能檢測到酒吧按鈕是選擇?那麼我怎樣才能避免這個問題呢? 請幫我一把。
謝謝!