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

Custom tint color not used #14

Closed
KrauseFx opened this issue Nov 30, 2013 · 5 comments
Closed

Custom tint color not used #14

KrauseFx opened this issue Nov 30, 2013 · 5 comments

Comments

@KrauseFx
Copy link

Maybe I'm missing something, but the tint color of the email dialog is not passed.
Actual Result with OvershareKit: https://www.dropbox.com/s/wkfuxpgye9jjvri/Screenshot%202013-11-30%2018.26.39.png

Wanted Result: https://www.dropbox.com/s/tccor4scsaioxw7/Screenshot%202013-11-30%2018.26.49.png

The app itself has the correct tint color set: https://www.dropbox.com/s/umzvttlvsml2nh7/Screenshot%202013-11-30%2018.26.56.png

@jaredsinclair
Copy link
Contributor

Can I see your code?

Sent from my iPhone

On Nov 30, 2013, at 12:27 PM, Felix Krause notifications@github.com wrote:

Maybe I'm missing something, but the tint color of the email dialog is not passed.
Actual Result with OvershareKit: https://www.dropbox.com/s/wkfuxpgye9jjvri/Screenshot%202013-11-30%2018.26.39.png

Wanted Result: https://www.dropbox.com/s/tccor4scsaioxw7/Screenshot%202013-11-30%2018.26.49.png

The app itself has the correct tint color set: https://www.dropbox.com/s/umzvttlvsml2nh7/Screenshot%202013-11-30%2018.26.56.png


Reply to this email directly or view it on GitHub.

@KrauseFx
Copy link
Author

KrauseFx commented Dec 1, 2013

Setting the tint color

    UIColor *tintColor = [UIColor whiteColor];
    [[UIWindow appearance] setTintColor:tintColor];

    UIColor *barTintColor = [UIColor greenColor];

    [[UINavigationBar appearance] setBarTintColor:barTintColor];
    [[UINavigationBar appearance] setTitleTextAttributes:@{
                                                           NSForegroundColorAttributeName:[UIColor whiteColor]
                                                           }];

Calling OvershareKit

OSKShareableContent *shareSheet = [OSKShareableContent contentFromText:share];
[[OSKPresentationManager sharedInstance] presentActivitySheetForContent:shareSheet
                                                   presentingViewController:self.navigationController
                                                                    options:nil]

What's missing:

MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
...
[mailController.navigationBar setTintColor:[UIWindow appearance].tintColor];

@jaredsinclair
Copy link
Contributor

Checkout OSKPresentationViewControllers.h, one of the delegate protocol hooks into the OSKPresentationManager. Specifically, check out line 41:

`

  • (void)presentationManager:(OSKPresentationManager *)manager
    willPresentSystemViewController:(UIViewController *)systemViewController
    `

If I understand the code you posted, you should be able to place the “what’s missing” code in there and tweak the appearance as needed.

Jared Sinclair
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Sunday, December 1, 2013 at 5:12 AM, Felix Krause wrote:

Setting the tint color
UIColor *tintColor = [UIColor whiteColor]; [[UIWindow appearance] setTintColor:tintColor]; UIColor *barTintColor = [UIColor greenColor]; [[UINavigationBar appearance] setBarTintColor:barTintColor]; [[UINavigationBar appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor whiteColor] }];

Calling OvershareKit
OSKShareableContent *shareSheet = [OSKShareableContent contentFromText:share]; [[OSKPresentationManager sharedInstance] presentActivitySheetForContent:shareSheet presentingViewController:self.navigationController options:nil]

What's missing:
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init]; ... [mailController.navigationBar setTintColor:[UIWindow appearance].tintColor];


Reply to this email directly or view it on GitHub (#14 (comment)).

@KrauseFx
Copy link
Author

KrauseFx commented Dec 2, 2013

Thanks, that's working.
Still, this is an issue of the library: this should happen automatically for system view controllers.

This problem occurs every time you set a navigation bar background color and a font color, since only the navigation bar background color is applied to the mail composer sheet.

@jaredsinclair
Copy link
Contributor

System view controllers (the Mail and Messages ones at least) should use their default navigation bar appearance. Otherwise, it may not be clear to users that they're using a remote instance of a built-in app.

This is why all non-system modal view controllers in OvershareKit use OSKNavigationController, an otherwise vanilla subclass of UINavigationController. That way you can apply custom appearance changes to that subclass without affecting system-provided navigation bars.

Sent from my iPhone

On Dec 2, 2013, at 5:38 AM, Felix Krause notifications@github.com wrote:

Thanks, that's working.
Still, this is an issue of the library: this should happen automatically for system view controllers.

This problem occurs every time you set a navigation bar background color and a font color, since only the navigation bar background color is applied to the mail composer sheet.


Reply to this email directly or view it on GitHub.

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