[英]iPhone, UINavigationController and UITabBar how to present a modal dialog regardless of the selected tab?
我在應用程序中有一個UINavigationController和一個UITabBar。 標簽欄中的每個ViewController都有自己的UINavigationController。
無論當前選擇的選項卡如何,我都希望能夠向用戶呈現模式對話框(警報/提醒/合法/加入郵件列表)。
現在我有一個我的UIViewControllers處理呈現對話框的行為,但除非選中了選項卡,否則用戶將看不到它。
我該如何解決這個問題? 故事板浮現在腦海中,但我的項目太深,無法在當前狀態下重寫故事板。
謝謝!
你可以在UITabBarController上呈現它。
[tabBarController presentModalViewController:animated:];
...或者您可以輕松地將UIAlertView /創建類別 子類化為顯示自定義模態視圖,只需調用即可
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@""
message:@""
delegate:nil
cancelButtonTitle:@""
otherButtonTitles:nil];
[alert showCustom]; // <---- FROM CATEGORY
[alert release];
這是一個例子: http : //goo.gl/7jaE8
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.