Masking is one of those subtle effects that can help bring our app design to the next level. The complete source code can be found here. To obtain this mix, we need to change just two lines from the example above: bottom)Īnother visually pleasing technique is mixing the fade effect with a blur. In the following example we take the sample code from How to control safe area insets in SwiftUI and add a subtle fading effect below the button: While we don't have to use gradients with masks, this fading technique is very popular in iOS. The gradient color in the middle doesn't matter. Here we use a linear gradient with three stops. Mask(alignment:_:) uses the mask opacity to determine what is shown from the original view, for example: Color. fixedSize() // □□ Ignores the proposed 200x200 points size
0 Comments
Leave a Reply. |