이것은 적어도 UIAppearance 프로토콜을 사용하는 제 경우에는 iOS 11에서 변경된 것으로 보입니다. 버그인지 고의인지 확실하지 않습니다.
컨트롤이 모두 상태를 만족하면 폰트 만 적용한다는 의미에서 함께 값을 마스크 할 수 없음을 발견했습니다 (예 : .normal|.disabled
).
for controlState in [UIControlState.normal, UIControlState.disabled, UIControlState.focused, UIControlState.highlighted, UIControlState.selected] {
UIBarButtonItem.appearance().setTitleTextAttributes([NSFontAttributeName: customFontName, for: controlState);
}
다음 UIAppearance 프로토콜을 사방으로 업데이트 사용하기 위해
for controlState in [UIControlState.normal, UIControlState.disabled, UIControlState.focused, UIControlState.highlighted, UIControlState.selected] {
barButton.setTitleTextAttributes([NSFontAttributeName: customFontName], for: controlState)
}
:
그래서 나는이 일을 결국