ios - NavigationBar's title showing only the half-top -


to make long story short, that's get:

http://img839.imageshack.us/img839/9461/capturedcran20130418000x.png

here code appdelegate:

[[uinavigationbar appearance] setbackgroundimage:[uiimage imagenamed:@"main_bar.png"] forbarmetrics:uibarmetricsdefault]; [[uinavigationbar appearance] settitletextattributes:  [nsdictionary dictionarywithobjectsandkeys:   //[uicolor colorwithred:125.0/255.0 green:111.0/255.0 blue:100.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, 0)],   //uitextattributetextshadowoffset,   [uifont fontwithname:@"pacifico" size:25],   uitextattributefont,   nil]]; [[uinavigationbar appearance] settitleverticalpositionadjustment:-10 forbarmetrics:uibarmetricsdefault]; 

what can possibly problem ?

i've had similar problems , sorted them out using this:

- (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil {     self = [super initwithnibname:nibnameornil bundle:nibbundleornil];     if (self) {         self.title = @"home";         self.tabbaritem.image = [uiimage imagenamed:@"main_bar.png"];         cgrect frame = cgrectmake(0, 0, 400, 44);         uilabel *label = [[uilabel alloc] initwithframe:frame];         label.backgroundcolor = [uicolor clearcolor];         label.font = [uifont boldsystemfontofsize:20.0];         label.shadowcolor = [uifont fontwithname:@"pacifico" size:25];         label.textalignment = uitextalignmentcenter;         label.textcolor = [uicolor whitecolor];         self.navigationitem.titleview = label;         label.text = nslocalizedstring(@"remindbox", @"");     }     return self; } 

you need tweek bit work font. helps.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -