[英]iPhone - Change target or selector for Back Button on UINavigationController
[英]uinavigationcontroller back button font change not quite correct
我正在代碼中執行以下操作,以更改后退按鈕的字體:
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,[UIFont fontWithName:@"Freshman" size:13.0f],UITextAttributeFont, nil] forState:UIControlStateNormal];
但是“返回”一詞在返回按鈕的頂部很尷尬,沒有像通常那樣居中放置。 我說的是它在頂部和底部居中,而不是從右到左。 我怎樣才能解決這個問題? 似乎只能使用UITextAttributeShadow更改Shadow和ShadowOffset,所以我不知道如何使其居中。
任何幫助表示贊賞!
嘗試這樣的事情:
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, 10) forBarMetrics:UIBarMetricsDefault];
請檢查參考文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.