14 HAZİRAN 2014, CUMARTESİ
Bir UİAlertController düzgün bir iPad kullanarak zararlı, iOS 8
İOS 8.0, Elma UIAlertController UIActionSheet yerine getirmiştir. Ne yazık ki, Apple sunulacağı konusunda herhangi bir bilgi çıkmadı. HayaGeek bu blog hakkında entry, ancak, iPad üzerinde çalışmak için görünmüyor bir buldum. Görünümü tamamen yersiz
Yanlış:
Doğru:
Aşağıdaki kod arayüzü üzerinde göstermek için kullanın:
let alert = UIAlertController()
// setting buttons
self.presentModalViewController(alert, animated: true)
İPad için eklemek için başka bir yol var mı? Ya da Apple iPad, ya da uygulanan değil, henüz unuttun?
CEVAP
15 HAZİRAN 2014, Pazar
UIPopoverPresentationController
kullanarak bir popover UIAlertController
hediye edebilirsiniz.
N-C: İçinde
UIViewController *self; // code assumes you're in a view controller
UIButton *button; // the button you want to show the popup sheet from
UIAlertController *alertController;
UIAlertAction *destroyAction;
UIAlertAction *otherAction;
alertController = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
destroyAction = [UIAlertAction actionWithTitle:@"Remove All Data"
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *action) {
// do destructive stuff here
}];
otherAction = [UIAlertAction actionWithTitle:@"Blah"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// do something here
}];
// note: you can control the order buttons are shown, unlike UIActionSheet
[alertController addAction:destroyAction];
[alertController addAction:otherAction];
[alertController setModalPresentationStyle:UIModalPresentationPopover];
UIPopoverPresentationController *popPresenter = [alertController
popoverPresentationController];
popPresenter.sourceView = button;
popPresenter.sourceRect = button.bounds;
[self presentViewController:alertController animated:YES completion:nil];
Bunu Paylaş:
Nasıl düzgün S4 sınıfı yuvaları Roxyge...
İPad kullanıcıları jQuery kullanarak t...
Nasıl dokunma olayları jQuery kullanar...
iPad App Web: Sanal Klavye Safari Java...
HTML5 ve iPad kullanarak yakalama İmza...