Sharekit настроить цвет кнопки просмотра модели - PullRequest
0 голосов
/ 14 мая 2011

Lovin 'Sharekit

Есть настраиваемые фоновые изображения для панелей инструментов, но вы хотите изменить цвет кнопки в модальном представлении, которое отображает, какая ссылка используется (например, представление модели ссылок Twitter) ... просто можноне могу найти какой файл, чтобы добавить мой настраиваемый штрих-код кнопки панели навигации к

Пытался, но не могу найти нужную комбинацию ... кто-нибудь знает?

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

1 Ответ

1 голос
/ 20 мая 2011

В 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;
}

Подкрашивает все кнопки навигационной панели (включая кнопку Отмена)

Viola!

...