1
我想創建一個沒有取消按鈕的AlertView。UIAlertView alertView.cancelButtonIndex = -1;不工作
這是代碼我曾嘗試:
alertView.cancelButtonIndex = -1;
它似乎並不與iOS 7
任何想法來工作?
感謝,
我想創建一個沒有取消按鈕的AlertView。UIAlertView alertView.cancelButtonIndex = -1;不工作
這是代碼我曾嘗試:
alertView.cancelButtonIndex = -1;
它似乎並不與iOS 7
任何想法來工作?
感謝,
1)在使用此代碼按「做點按鈕」,可以做一些動作,但不會導致alertView
隱藏
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Title" message:@"The message." delegate:self cancelButtonTitle:nil otherButtonTitles: @"Do something", nil] show];
#pragma mark - UIAlertViewDelegate
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView {
return NO;
}
2)如果使用這種代碼將不會有在alertView
按鈕(我想這是你真正需要)
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Title" message:@"The message." delegate:self cancelButtonTitle:nil otherButtonTitles:nil] show];