Tuesday, January 11, 2011

Add Custom Title to UINavigationBar

    UILabel * label = [[[UILabel alloc] initWithFrame:CGRectMake(0,0,45,45)] autorelease];
    label.textColor = [UIColor grayColor];
    label.backgroundColor=[UIColor clearColor];
    label.font = [UIFont boldSystemFontOfSize:20];
    self.navigationItem.titleView = label;
    label.text=@"Search"; //CUSTOM TITLE
    [label sizeToFit];
    [label release];

No comments:

Post a Comment