2013-03-18 103 views
1

我不確定這是否可更改,但我注意到我的自定義導航控制器的標題上有輕微的陰影。刪除文字陰影

圖片:http://imgur.com/60XjLWE

它使文字看起來模糊,這是一種煩人。

這是代碼我使用:[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor colorWithRed:52.0/255.0 green:54.0/255.0 blue:61.0/255.0 alpha:1.0],UITextAttributeTextColor, [UIFont fontWithName:@"Helvetica Neue-Bold" size:0.0],UITextAttributeFont, nil]];

任何想法如何去除標題的影子?

回答

-2

將這個在你的AppDelegate

[[UINavigationBar appearance]setShadowImage:[[UIImage alloc] init]]; 
+5

這隻能從UINavigationBar的下方刪除影子。 不在標題內。 – 2013-06-21 05:04:06

4

你可以把它透明:

[[UINavigationBar appearance] setTitleTextAttributes: 
    [NSDictionary dictionaryWithObjectsAndKeys: 
    [UIColor colorWithRed:52.0/255.0 green:54.0/255.0 blue:61.0/255.0 alpha:1.0], UITextAttributeTextColor, 
    [UIColor clearColor], UITextAttributeTextShadowColor, 
    [UIFont fontWithName:@"Helvetica Neue-Bold" size:0.0], UITextAttributeFont, nil]];