Giter VIP home page Giter VIP logo

Comments (19)

TimOliver avatar TimOliver commented on August 19, 2024

Hey Dmitri! Thanks for the comment!

They already do! Since they icons are displayed within a standard UINavigationController, they already automatically conform to the global app-wide [UIView setTintColor] or the more local [UINavigationBar setBarTintColor] properties of iOS 7.

I'm running the latest version of TOWebViewController in the latest build of one of my apps and I was able to re-tint all of the icons to red with no worries.

All the info on setting the iOS 7 tint properties are on the Apple site: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/AppearanceCustomization.html

Let me know if you still have any troubles with it!

from towebviewcontroller.

voronianski avatar voronianski commented on August 19, 2024

I tried with setBarTint but it adds this color as background:

TOWebViewController *webViewCtrl = [[TOWebViewController alloc] initWithURL:url];

UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:webViewCtrl];

[nav.navigationBar setBarTintColor:[UIColor redColor]];
[self presentViewController:nav animated:YES completion:nil];

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

Oops! My bad! I got my methods mixed up. Sorry! It's just tintColor, not barTintColor! So confusing! ^_^;

If it's just the one web view controller you want to tint, you can simply do this:
nav.view.tintColor = [UIColor redColor];

That'll tint both the navigation bar and the tool bar.

If you want the red tinting across the whole app, in your app delegate, apply the [UIColor redColor] to the main UIWindow object in the application:didFinishLaunchingWithOptions: method.

Let me know how you go!

from towebviewcontroller.

voronianski avatar voronianski commented on August 19, 2024

@TimOliver worked pretty well with nav.view.tintColor = [UIColor redColor];, thanks!

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

Awesome! Glad to hear that worked!
My pleasure! Enjoy!

from towebviewcontroller.

voronianski avatar voronianski commented on August 19, 2024

;)

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Personally I would like to be able to tint the navigation buttons (back/next load etc) without also tinting the Navigation Bar. Could you expose the buttons as properties so this can be done via xxxxxButton.tintColor

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

Thanks for the reply Michael!

Ah okay! Tinting the bar button items on iOS 7 is actually an automatic process, hence why there are no properties regarding them in this controller. The system itself actually recolours the icons itself based off their alpha channels, so changing the colours of the icons from the UIImage category won't do anything.

Apple have outlined how the system works here:
https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/TransitionGuide/AppearanceCustomization.html#//apple_ref/doc/uid/TP40013174-CH15-SW3

If you want to recolour JUST this view controller, you just have to call setTintColor: on its UINavigationController view property.

Hope that helped!

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Hi Tim,

Thanks for the reply.

I mean if you can expose the buttons as properties then I can apply tintColor per button as I need.

At the moment I have to subclass and override your setUpNavigationButtons method and then once the button are created, set the tintColor accordingly.

Remember setting a tintColor on an object will override any tint colour set by by any view higher the view hierarchy etc. So for example in my subclassed method, I currently do this (see the last line):

UIImage *backButtonImage = [UIImage   TOWebViewControllerIcon_backButtonWithAttributes:self.buttonThemeAttributes];
if (self.backButton == nil) {
    self.backButton = [UIButton buttonWithType:buttonType];
    [self.backButton setFrame:buttonFrame];
    [self.backButton setShowsTouchWhenHighlighted:YES];
}
[self.backButton setImage:backButtonImage forState:UIControlStateNormal];
self.backButton.tintColor = [UIColor redColour]; // OVERRIDE TINT COLOUR

obviously it would be much nicer to have a property to set the buttons as a whole or to access them individually rather than subclassing and overriding.

Thanks again for a great framework.

regards, Michael.

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

No worries!

Uhh, hang on. What are you trying to do exactly? Do you want to set the tint colour of the navigation buttons to something other than the the global tint colour? And are you on iPad, iPhone or both?

Thanks a lot! Glad you're enjoying it! :)

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Yes exactly. Global tint colour is white but designer wants other elements like these types of buttons to be a different colour.

I know it's not a common approach but Apple do allow it :-)

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

Ohh I see. Fair enough! Sorry about the confusion!

Done! :)

c87e5a2

Let me know how that goes! Enjoy! :)

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Wow - you are a star!

I will test out a bit later. Thanks again. Michael.

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

No worries Michael! My pleasure! :)

Let me know how it goes!

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

I will do. BTW Any idea when the cocoapod might be updated?

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

I updated the podspec and did another push when I uploaded it, so if you do another 'pod install', it SHOULD come down already. :)

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Brilliant thanks.

from towebviewcontroller.

wuf810 avatar wuf810 commented on August 19, 2024

Just tested. Works perfectly. Thanks again for doing this.

from towebviewcontroller.

TimOliver avatar TimOliver commented on August 19, 2024

Awesome! I'm really glad to hear that!

My pleasure Michael! Good luck with the app! :)

On 27 August 2014 00:37, Michael Kaye [email protected] wrote:

Just tested. Works perfectly. Thanks again for doing this.


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

from towebviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.