2012-06-22 34 views
7

我有以下問題:瀏覽屏幕的標籤欄和按鈕

在我的應用程序有兩種方法可以導航到其他屏幕:通過按鈕或標籤欄。

所有屏幕都有調整其他屏幕的選項卡欄,但主屏幕是有按鈕但沒有選項卡欄的屏幕。

當我開始開發我的應用程序時,我選擇了標籤欄應用程序模板,如果我通過按下標籤調用屏幕,它會正常工作。當我使用主屏幕時,問題開始:

  • 我需要在此特定屏幕中「隱藏」標籤欄。
  • 在主屏幕中,如果我通過按鈕調用新屏幕,則標籤欄會在新屏幕中消失(因爲屏幕是通過按鈕調用的,而不是通過標籤欄)。

要解決這我想,也許我可以創建自定義標籤欄(我還不知道如何),並把它在我的屏幕就像一個UIControl,所以以這種方式,如果我需要改變標籤欄的修改將能夠在調用該控件的所有屏幕上進行。

你有什麼建議?創建自定義標籤欄並像UIControl一樣使用它是個不錯的主意?如果是的話,我該如何創建一個?

我使用它來調用Windows

RecurringGiftListViewController *listViewController = [[RecurringGiftListViewController alloc] initWithNibName:@"RecurringGiftListViewController" bundle:nil]; 
listViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
[self presentModalViewController:listViewController animated:YES]; 
[listViewController release]; 
+0

您可以把您在使用推看法位代碼? – Ahmed

+0

@Ahmed當然,我使用,我用這個來調用窗口RecurringGiftListViewController * listViewController = [[RecurringGiftListViewController alloc] initWithNibName:@「RecurringGiftListViewController」bundle:nil]; listViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:listViewController animated:YES]; [listViewController release]; – avmauricio

回答

1

它聽起來並不像歐應使用的TabBar在所有。當您按下其中一個按鈕時,選項卡不應該消失。把它想象成你的應用的主菜單。您可以擁有其他屏幕,例如導航控制器或接管整個屏幕的模態對話框,但您應該可以退回到TabBar。

再次考慮用戶界面的結構。也許你可以重新安排它,讓你的「主屏幕」一個對話框可以從其中一個tabbar頁面訪問?

+0

問題是,應用程序的設計是由客戶端創建的,所以我不認爲我可以改變它 – avmauricio

+1

當客戶給你一個糟糕的設計時,你需要教他們爲什麼它不好,以及UI範式應該工作。我有一個客戶,他們基本上爲他們的應用程序做了一個網頁設計,完成了小小的複選框。試圖將可可觸摸變成糟糕的設計只會導致你痛苦,並導致產品不好。這是一個雙輸的局面。 – geon

1

你的問題是,你提出你的另一種觀點'模態'。這種替換代碼:

RecurringGiftListViewController *listViewController = [[RecurringGiftListViewController alloc] initWithNibName:@"RecurringGiftListViewController" bundle:nil];    
//listViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
[self.navigationController pushViewController:listViewController animated:YES]; 
[listViewController release]; 

希望這將有助於

相關問題