iPhone 修改navigation bar 字體和顏色

- (void)setTitle:(NSString *) title

{

    [super setTitle:title];

    UILabel *titleView = (UILabel *)self.navigationItem.titleView;

    if(!titleView){

         titleView = [[UILabel alloc] initWithFrame:CGRectZero];

         titleView.backgroundColor = [UIColor clearColor];

         titleView.font = [UIFont boldSystemFontOfSize:20.0];

         titleView.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];

         titleView.textColor = [UIColor blackColor];

         self.navigationItem.titleView = titleView;

    }

   titleView.text = title;

   [titleView sizeToFit];

}

這個羣裏找的,是圖片,我一個個的碼上去的。。。


發佈了25 篇原創文章 · 獲贊 1 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章