2014-01-17 25 views
1

以下是我的問題:我在UINavigationController的頂部有一個導航欄。我有它設置爲禁用和重新啓用時,某些彈出屏幕上。一種情況不起作用:當Dropbox彈出窗口出現在屏幕上時,該欄會禁用,因爲它應該是。但是,當我關閉彈出窗口(按取消)時,導航欄會重新啓用,但應用程序處於打開狀態時它會保持灰顯狀態,儘管它的功能正常。在這一點上它應該回到藍色。當我關閉其他的餡餅時它會變成藍色。只是Dropbox的一個給我的問題。我沒有看到任何一種NavBar的「Highlighted」屬性,並且我正確切換了UserInteractionEnabled屬性。有任何想法嗎?iOS導航欄功能正常,但顏色錯誤

+0

一些相關的代碼? – nhgrif

回答

1

將此代碼置於popover的取消操作。

你可以用這一個ios7

[self.navigationController.navigationBar setBarTintColor:[UIColor blueColor]]; 

這一個是iOS6的

[self.navigationController.navigationBar setTintColor:[UIColor blueColor]]; 

感謝

1
// This is for iOS 7.0 or more than that. 

    if ([self.navigationController.navigationBar respondsToSelector:@selector(setBarTintColor:)]) { 
    self.navigationController.navigationBar.barTintColor = [UIColor blueColor]; 
} else { 
    [self.navigationController.navigationBar setTintColor:[UIColor blueColor]]; 
} 

// For text alignments 

    [[UINavigationBar appearance] setTitleTextAttributes: 
    [NSDictionary dictionaryWithObjectsAndKeys: 
     [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0], 
     UITextAttributeTextColor, 
     [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0], 
     UITextAttributeTextShadowColor, 
     [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], 
     UITextAttributeTextShadowOffset, 
     [UIFont fontWithName:@"Helvetica-Bold" size:20.0],//[UIFont fontWithName:@"DynoBold" size:20.0], 
     UITextAttributeFont, 
     nil]]; 
+0

這改變了整個酒吧的色調。對不起,不清楚,但我不希望酒吧改變顏色,只是按鈕上的文字/圖標。 – Hash88

+0

@ leksah255應用導航欄外觀。編輯我的答案,請檢查它。 – Madhu