How to specify a bright appearance for the secondary text of the Today Center widget?

I am working on my first Today Center widget, which simply consists of three shortcuts on the default storyboard. It works great, but I read in the iOS Human Interface Guidelines that secondary text should “use the vibrant look of the system” with notificationCenterVibrancyEffect.

What is the right way to add this vibration effect to my two secondary labels? I read about UIVisualEffectView, but it’s still not clear to me how to use it for this purpose. I don’t think I want to put a blurry look behind my shortcuts, because Notification Center is already blurring the background.

+4
source share
2 answers

UIVisualEffectView, when it is configured using UIVibrancyEffect, is intended to be used as a container - just uncheck your own contentViewand you will get an appropriate view on top of the erosion notification center. The color of the text does not matter; when it is added to contentView, it receives a special treatment and is effectively always visualized with the same appearance, although you can still customize the alpha representation (and not the color of the text) to make it more or less noticeable.

vibrancy examples

+1
source

Good afternoon, first of all, u should use the correct hierarchy of views when U add some objects in the VisualEffectView example:

enter image description here

UIVibrancyEffect, UIVisualEffectView, , . UIVibranceEffect :

enter image description here

, (fooobar.com/questions/263523/...) Apple , (, , Sports.ru ):

enter image description here

... , "", notificationCenterVibrancyEffect. . https://www.omnigroup.com/developer/how-to-make-text-in-a-uivisualeffectview-readable-on-any-background

+1

Source: https://habr.com/ru/post/1624115/


All Articles