[英]iOS back button text disappears when clicking
我想我找到了根本原因。 我通過創建新的UITextAttributes
在UIBarButtonItem.Appearance
代理的主題中設置字體屬性:
var proxyUIBarButton = UIBarButtonItem.Appearance;
proxyUIBarButton.SetTitleTextAttributes(new UITextAttributes { Font = UIFont.FromName(RegularFontName, 20), TextColor = AtxBlue }, UIControlState.Normal);
它在基於默認屬性的屬性時起作用:
var attr = proxyUIBarButton.GetTitleTextAttributes(UIControlState.Application);
attr.Font = UIFont.FromName(RegularFontName, 20);
attr.TextColor = AtxBlue;
proxyUIBarButton.SetTitleTextAttributes(attr, UIControlState.Normal);
希望這可以幫助其他有同樣問題的人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.