Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant change the NavigationBar style #23

Open
hazemmaher92 opened this issue Oct 1, 2017 · 5 comments
Open

Cant change the NavigationBar style #23

hazemmaher92 opened this issue Oct 1, 2017 · 5 comments

Comments

@hazemmaher92
Copy link

[[UINavigationBar appearance] setBarTintColor:[UIColor GreenColor]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:18],NSForegroundColorAttributeName: [UIColor whiteColor]}];
i'am adding style to the UINavigationBar , but when I present [[Hotline sharedInstance] showConversations:self]; or getting [[Hotline sharedInstance] getConversationsControllerForEmbed] and present it in a custom navigation bar it doesn't follow my style , and it creates a new style, that new style override my app style

How to force that UINavigationBar to follow my style

@harish-kumarc
Copy link
Contributor

harish-kumarc commented Oct 1, 2017

Hi @hazemmaher92
Hotline SDK contains a "HLTheme.plist" file under HLResource.bundle from where you can control the style(Color/Font/Images) of Hotline view into your app. It is quite straight forward, you just need to edit key values into your theme file. Please check here for more on customization.
For navigation bar changes please check keys in the attached screenshot here.
Thanks

screen shot 2017-10-02 at 2 18 12 am

@hazemmaher92
Copy link
Author

hazemmaher92 commented Oct 5, 2017

yes, doing that fixed the navigationBar Style , but after dismissing the Hotline ViewController (by tapping the close button) the default UINavigationBar title color changes to black in the whole app.

@harish-kumarc
Copy link
Contributor

Hi @hazemmaher92
Can you give us more information about your implementation like are using embed view api etc. Its good if you can share your Hotline implementation code snippet.
In NavigationBar theme we recommend to use same title color, font, size that you are using in your app so that it will match with style.
Thanks

@hazemmaher92
Copy link
Author

UINavigationBar style in the AppDelegate
[[UINavigationBar appearance] setBarTintColor:[UIColor GreenColor]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:18],NSForegroundColorAttributeName: [UIColor whiteColor]}];
HotLine implementation
[[Hotline sharedInstance] showConversations:self];

Hotline configuration ( I have only changed the NavigationBar section matching my app color scheme)
screen shot 2017-10-05 at 12 29 09 pm

My UINavigationBar before presenting the hotline
img_2386

My UINavigationBar after dismissing the hotline (by tapping the close button)
img_2385

thank a lot for your support

@harish-kumarc
Copy link
Contributor

Hi @hazemmaher92
I have a quick solution for the issue you are facing. Can you please change the navigation bar color in viewwillappear of the controller where you are presenting Hotline. Check code snippet here

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setTitleTextAttributes:
     @{NSForegroundColorAttributeName:[UIColor yellowColor]}];
}

We will surely analyse why default navigation title color is override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants