我有一個模式UINavController中的保存按鈕的問題。當我按下保存按鈕時,如果鍵盤仍然處於啓動狀態,請從鍵盤輸入數據,然後在發送信息時顯示UIProgressView。加快鍵盤解散或等待,直到它完成
我的問題是,鍵盤不夠快,所以當顯示UIProgressView的時候鍵盤仍然彈起來,並且它被添加到我的視圖的底部,它看起來很愚蠢。
我可以按回車鍵,然後按下鍵盤,然後按保存,沒有問題。但是,如果用戶跳過鍵盤返回鍵並右移右上角的保存按鈕,我遇到了問題。
理想情況下,我想實施一個簡短的等待聲明,以便它不會看到。或延遲後執行我的驗證,但沒有任何我嘗試過的。請幫忙。
代碼示例:
// end edit mode - should kill all keyboards
[[self.tableView superview] endEditing:YES];
// make sure everything is entered correctly and validates
[self validateEntryFields]; // keyboard not gone when this finishes
if (valid) { // progress view shows up towards bottom of view
HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = @"Adding User";
HUD.detailsLabelText = @"Please Wait";
[HUD showWhileExecuting:@selector(sendNewUserInformation) onTarget:self withObject:nil animated:YES];
}
但我不'如果他們只是殺了鍵盤,我希望他們能省下來,我同意這是一個乾淨的解決方案,我會看看我可以做些什麼 –
這不完全是我希望實現的,但它對我有用。同意其他意見,這是「應該」如何完成的,謝謝。 –