本文在不使用UIAlertController的狀況下,用最簡單的方法讓UIAlertView、UIActionSheet兼容iOS8.spa
//title置爲@""兼容iOS8 UIAlertView *delAlert = [[[UIAlertView alloc] initWithTitle:@"" message:@"刪除聯繫人?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"確認", nil] autorelease]; [delAlert show];
UIActionSheet *actionSheet = [[[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:[NSString stringWithFormat:NSLocalizedString(@"call", nil),self.phoneNumber] otherButtonTitles:NSLocalizedString(@"add to contact", nil),nil] autorelease]; actionSheet.tag = 1; [actionSheet showInView:self.view];
版權聲明:本文博客原創文章,博客,未經贊成,不得轉載。code