apptentive / apptentive-ios

Apptentive Legacy SDK for iOS. See https://github.com/apptentive/apptentive-kit-ios for Version 6.
http://www.apptentive.com/
BSD 3-Clause "New" or "Revised" License
146 stars 103 forks source link

ATMessageCenterViewController Nav bar tint is overwritten to WhiteColor #157

Closed HariPrasad closed 9 years ago

HariPrasad commented 9 years ago

If we use [ATConnect sharedConnection].tintColor to set custom color that will be over written to white color at line 122.

frankus commented 9 years ago

The tintColor property on the ATConnect object only affects the color of the bar button items in the navigation bar (as well as any active buttons in the Message Center UI).

Our intention was to allow people to override the bar tint color using UIAppearance, but you are correct that the way we explicitly set the barTintColor will override any other settings.

We are aware of the this issue and we'll be sure to keep you up to date when we have a fix available.

frankus commented 9 years ago

The 2.0.2 release (available on GitHub now and arriving on CocoaPods shortly) should fix this. You can now override the barTintColor for all Apptentive UI as follows:

[UINavigationBar appearanceWhenContainedIn:[ATNavigationController class], nil].barTintColor = myCustomBarTintColor;

You can adjust the tintColor of Apptentive view controllers using the (now deprecated) tintColor property on the ATConnect singleton, or the following code:

[UIView appearanceWhenContainedIn:[ATNavigationController class], nil].tintColor = myCustomTintColor;

Apptentive UI based on UIAlertController will continue to pick up your application window's tintColor property in iOS 8 and later. In iOS 7 the default colors cannot be overridden.

Please see the Customization Guide for more information.

CKUDG commented 9 years ago

@frankus is there also a swift 2.0 example?

Thanks much and best regards, C

frankus commented 9 years ago

Our existing example project should work. (I just ran the previous version through the conversion process—resulting in no source changes—and checked in the updated project file).

CKUDG commented 9 years ago

For iOS9 the "appearanceWhenContainedIn" isn't available anymore.. Now it's the following:

UINavigationBar.appearanceWhenContainedInInstancesOfClasses([ATNavigationController.self]).backgroundColor = ChooStyleKit.blue

best regards, C

frankus commented 9 years ago

Oh right, I forgot about that. I’ll make a note to add that to the documentation.

Thanks,

Frank