Re: Supporting dynamic type
Re: Supporting dynamic type
- Subject: Re: Supporting dynamic type
- From: Clare Kasemset <email@hidden>
- Date: Mon, 09 Oct 2017 10:00:17 +0900
> On Oct 7, 2017, at 2:19, Vincenzo Rubano <email@hidden> wrote:
>
> Hi Clare,
>
> thanks for your reply. I am not drawing anything manually, I am just using
> default system controls. I am interested in supporting dynamic type
> throughout the whole app as much as I can.
>
> Given that UIButton uses UILabel internally, I guess it’ll work properly
> after setting the adjustsFontForContentSizeCategory property on the UILabel
> appearance proxy. Won’t it?
Yes, that will work. For more fine grained control, you can access the label
via a property (for example in the case of UIButton, you can use the titleLabel
property).
>
> So the list of controls whose howToSupportDynamicType property is nil for me
> narrows down to:
> - UINavigationController (title, prompt, toolbar);
Starting in iOS 11, the best way to support dynamic type for navigation
controllers is to access its navigationBar property and then set the
prefersLargeTitles property to true. This will allow the bar to scale as needed
for Dynamic Type, in the same way that navigation bars across the system do.
If that is not an option, you can use the titleTextAttributes property on the
navigation bar to specify one of the text style fonts, but I do not recommend
this approach, as the navigation bar itself will not resize to fit the text. It
is probably better to leave the navigation bar alone until you are able to
leverage the support in iOS 11.
> - UITabBar (I’ve seen the changes introduced in iOS 11 thanks to James’
> reply, but what happens when linking against the iOS 10 SDK?);
Unfortunately, these changes will only take effect if your app links against
the iOS 11 SDK.
> - WKWebView (I’m already using a system provided text style within the
> webpage, but I am not sure that it is enough);
I am not sure if there is an equivalent property for web views. It is possible
that you may need to reload the webpage when the
UIContentSizeCategoryDidChangeNotification gets posted.
> - UISegmentedControl;
In iOS 11, segmented control has a similar solution as UITabBar, where you can
long press on it to see a larger version. As with UINavigationBar, the
segmented control itself has a fixed size, so if you set a text style font via
its title text attributes, the text may get clipped. Again, I would recommend
not doing anything here until you can leverage the support in iOS 11.
> - UISearchField;
Currently there is no way to customize the font of the search text.
> - AVPlayerViewController;
I don't believe there is API to customize the fonts in this view.
Please do file bugs about the accessibility regressions in Xcode 9, if you
haven't already. Thanks!
>
>
> Vincenzo Rubano
>
> NVApple team
> https://www.nvapple.it/about-us
>
>
>> Il giorno 06 ott 2017, alle ore 14:08, Clare Kasemset <email@hidden>
>> ha scritto:
>>
>> Hi Vincenzo,
>>
>> Which controls are you interested in? For example, UIButton gives you access
>> to the underlying UILabel, so you can set the property on that instead. Or
>> are you manually drawing text?
>>
>> Clare
>>
>> iPhoneから送信
>>
>> 2017/10/06 19:00、Vincenzo Rubano <email@hidden>のメール:
>>
>>> Hi all,
>>>
>>> since iOS 10.0 UIKit provides the UIContentSizeCategoryAdjusting trait
>>>
>>> https://developer.apple.com/documentation/uikit/uicontentsizecategoryadjusting
>>>
>>> which is very handy for supporting dynamic type without writing a ton of
>>> boilerplate code. By using it you can enable support for dynamic type from
>>> the UIAppearance proxy, which is even handier!
>>>
>>> However, according to docs only UILabel, UITextField and UITextView adopt
>>> it. What about other controls? Do you need to reload fonts the old way or
>>> do they have some “special” magic in order to support dynamic type
>>> properly? Or perhaps they can be coerced in some way to adopt the trait?
>>>
>>> Thanks in advance for your support
>>>
>>>
>>> Vincenzo Rubano
>>>
>>> NVApple team
>>> https://www.nvapple.it/about-us
>>>
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Accessibility-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden