For example, I have a method:

- (void)customizeAppearance
{
[[UINavigationBar appearance] setTitleTextAttributes:
    [NSDictionary dictionaryWithObjectsAndKeys:
        [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
        UITextAttributeTextColor,
        [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
        UITextAttributeTextShadowColor,
        [NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
        UITextAttributeTextShadowOffset,
        [UIFont fontWithName:@"Arial-Bold" size:0.0],
        UITextAttributeFont,
        nil]];
}

How can I make so that this method worked for whole applications?

有帮助吗?

解决方案

If you put this code in your app delegate in the finished lunching method that will effect all the app.

Pay attention that this will work only on iOS 5

其他提示

If you use this within a UIViewController just create your own subclass MyUIViewController and you may use it in every new screen you create. Just use MyUIViewController as your screen's superclass instead of the normal UIViewControler.

In general, this is a good idea, since you can easily add other behaviours to all your screens by only having to change code in your MyUIViewController.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top