텍스트 필드의 글꼴 크기를 테스트하기 위해 SwiftUI 프로젝트를 만들었습니다 (nib에서로드 된 SwiftUI, UITextField 및 UITextField에서). nib에서로드 된 UITextField의 기본 글꼴 크기가 일치하지 않음을 알았습니다.
코드를 github 링크에 업로드했습니다. https://github.com/felixmariaa/TestFontSize
다음은 SwiftUI의 기본 글꼴 크기를 보여주는 스크린 샷입니다. nib에서로드 된 TextField, UITextField 및 UITextField입니다.
nib에서로드 된 UITextField의 글꼴 크기가 너무 작고 일관성이없는 이유는 무엇입니까?
In the iOS version you are currently running (on an iPhone 11 Pro Max I assume something like iOS13) the default font for a programmatically created UITextField is font family SanFrancisco with size 17.0 (You can change that programmatically when you create an UITextField).
Meanwhile the default font of an Interface Builder's based UITextField, currently in Xcode is as well a SanFrancisco but with size 14.0 (you can change that from Interface Builder > Attributes Inspector > Font).
That's just how the tools we use currently behave.
타이포그래피에 대한 Apple 문서에서 직접 여기에 언급 한 내용에 대한 자세한 내용을 찾을 수 있습니다. https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography/ 여기서 기본 글꼴에 대해 읽을 수 있습니다. iOS 및 Xcode 용.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다