[英]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.