2011-05-13 34 views
0

的Lovin' SharekitSharekit自定義模型視圖按鈕顏色

定製的背景發生了工具欄,但要改變顯示共享哪個環節模式視圖按鈕的顏色(即Twitter的鏈接模型視圖).. .just找不到要添加我的自定義導航欄按鈕條碼的文件

一直在嘗試,但似乎無法找到正確的組合...任何人都知道嗎?

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    /* 
    Colour the Nav Bar buttons 
    */ 
    [self.navigationController.navigationBar applyCustomTintColor]; 
} 

回答

1

在SHKConfig.h

修改

#define SHKBarTintColorRed  219 /255.0 
#define SHKBarTintColorGreen 83 /255.0 
#define SHKBarTintColorBlue  106 /255.0 

添加/ 255.0你的號碼

這種預劃分我們的RGB顏色轉化爲一個浮點百分比UIColor

在SHK.m

修改showViewController功能

// Wrap the view in a nav controller if not already 
if (![vc respondsToSelector:@selector(pushViewController:animated:)]) 
{ 
    UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:vc] autorelease]; 

    if ([nav respondsToSelector:@selector(modalPresentationStyle)]) 
     nav.modalPresentationStyle = [SHK modalPresentationStyle]; 

    if ([nav respondsToSelector:@selector(modalTransitionStyle)]) 
     nav.modalTransitionStyle = [SHK modalTransitionStyle]; 

    nav.navigationBar.barStyle = nav.toolbar.barStyle = [SHK barStyle]; 

    // Added code 
    UIColor* c = [UIColor colorWithRed:SHKBarTintColorRed green:SHKBarTintColorGreen blue:SHKBarTintColorBlue alpha:1.0]; 
    [(UINavigationController *)vc navigationBar].tintColor = c; 
    // End added code 

    [topViewController presentModalViewController:nav animated:YES];    
    self.currentView = nav; 
} 

// Show the nav controller 
else 
{  
    if ([vc respondsToSelector:@selector(modalPresentationStyle)]) 
     vc.modalPresentationStyle = [SHK modalPresentationStyle]; 

    if ([vc respondsToSelector:@selector(modalTransitionStyle)]) 
     vc.modalTransitionStyle = [SHK modalTransitionStyle]; 

    [topViewController presentModalViewController:vc animated:YES]; 
    [(UINavigationController *)vc navigationBar].barStyle = 
    [(UINavigationController *)vc toolbar].barStyle = [SHK barStyle]; 

    // Added code 
    UIColor* c = [UIColor colorWithRed:SHKBarTintColorRed green:SHKBarTintColorGreen blue:SHKBarTintColorBlue alpha:1.0]; 
    [(UINavigationController *)vc navigationBar].tintColor = c; 
    // End added code 

    self.currentView = vc; 
} 

這種色調所有的導航欄按鈕(包括取消按鈕)

中提琴!