Trying to implement support for Dynamic Type and have an issue. I set the style I want to use on a label or something in Interface Builder. I register for the UIContentSizeCategoryDidChangeNotification, and in the handler, I set the label's font to ... what? How do I know what style to use? Shouldn't there be an accessor that lets me find that out? If not, I have to put it in 2 places, which means they'll get out of sync and I'll be annoyed. Any thoughts?
iOS - Dynamic Type and Interface Builder
476 Views Asked by MacsimusPrime At
2
There are 2 best solutions below
0
XLE_22
On
Since iOS 10, there's no need to follow this rationale because the adjustsFontForContentSizeCategory property allows an automatic scaling of the font sizes according to the content type size selected in the settings.
All the text styles are well defined in the Apple reference site and their size variations as well.
Related Questions in IOS
- URLSession requesting JSON array from server not working
- Incorrect display of LinearGradientBrush in IOS
- Module not found when building flutter app for IOS
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Expo Deep linking on iOS is not working (because of Google sign-in?)
- On iOS, the keyboard does not offer a 6-character SMS code
- Hi, there is an error happened when I build my flutter app, after I'm installing firebase packages occurs that error
- The copy/paste functionalities don't work only on iOS in the Flutter app
- Hide LiveActivityIntent Button from Shortcuts App
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Actionable notification api call not working in background
- Accessibility : Full keyboard access with scroll view in swiftui
- There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'XXXX'
- I am getting "binding has not yet been initialized" error when trying to connect firebase with flutter
Related Questions in INTERFACE-BUILDER
- Sheets in UIKit
- I can't understand what the problem with the Navigator Controller
- Cannot find Interface Builder Preview in Xcode 15
- Set maxwidth on UITextfield
- Custom Font for iOS Only shows if Added in IB?
- How would I use Interface Builder with CNContactViewController in iOS using Xcode and Swift?
- How to change a button's background color
- Why is my UIStackView's fill proportionally distribution property not working as expected?
- Xcode 15 beta 2 - Build Error: "Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x600002588860>'"
- Xcode example of universal .app with assembly intel .s file and arm .s file
- NSUnknownKeyException when connecting property IB
- How to add layout widget to contain your input and eye icon
- ContentHuggingPriority and CompressionResistance not honored by StackView with custom control as subview
- Xcode constraints not changing equally
- iOS: Navigation Style: Navigator, Browser, Editor
Related Questions in ACCESSIBILITY
- Why does getRootInActiveWindow() always returns null in Accessibility Event
- Accessibility : Full keyboard access with scroll view in swiftui
- How to create an overlay window over a certain element via AccessibilityService and scroll it too?
- Problem with Delphi android app and talkback
- How can I get the screen reader to read controls that are not tab stops (e.g. static labels)?
- NVDA is not announcing "dialog" when Modal opens
- Accessibility sequence not working with "HorizontalPager" in Android Jetpack Compose
- Android recyclerview - cant able to navigate items using accessibility focus
- Using aria-describedby to reference description that contains more than just text
- What is the correct usage of aria-describedby?
- How to make related checkboxes accessible using wai-aria tags?
- How to close compose dialog in accessibility mode?
- How do I make an "add to list" pattern accessible for assistive technology users?
- Autogenerate link title based on URL/target for accessibility
- typeViewClicked event is not detected when target window is developed by jetpack compose by my accessibilityservice
Related Questions in DYNAMIC-TYPE-FEATURE
- UITextField rightView alignment
- How to build square cells in a SwiftUI LazyVGrid containing dynamic type
- UIImageView intrinsic content size behavior with Dynamic Type
- iOS Swift: UIAlertController ignores maximumContentSizeCategory
- maximumContentSizeCategory in iOS 14
- Dynamic Text Sizing in NSAttributedString
- Programmatically Collapse NavigationSplitView to One Column
- iOS Swift: maximumContentSizeCategory not working on UILabel
- How to make UILabel font size static (disregard of iOS setting font size change)?
- Keeping texts of different sizes aligned at top as the dynamic type size increases
- How to make dynamic height for UICollectionViewCell with dynamic type and fixed width?
- iOS Swift how to detect Dynamic Type Sizes with customer Font
- After changing the preferred content size, the font size in some of my reusable cells' labels are still unchanged
- Bold dynamic type in Swift
- What values can be used in NSFont.TextStyleOptionKey
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I don’t think this will satisfy you, but set the font to
[UIFont preferredFontForTextStyle:UIFontTextStyleTitle2or whatever style you set in Interface Builder.Ignore the setting in Interface Builder. It’s not even worth setting. Interface Builder is a (mostly) static representation of the initial state of your views, but this is Dynamic Type.
You could subclass
UILabelto make it dynamic, and/or join us on the dark side of setting up views in code.