Shadow, Padding

Tram Ho

SwiftUI: Shadow

In this tutorial, we will learn what Shadow is in SwiftUI. You will learn:

  • How to use Shadow.

Prerequisites

To follow along with this tutorial, you’ll need some basic knowledge about:

  • Swift basics.
  • Xcode 11 and above

Shadow

Adding shadow and corner radius is a mess in UIKit, you will need to create two views to achieve that. Below is just one example of including radius and shadow inclusion.

You can adjust the radius of the shadow.

You can even move the shadow around with the x and y axes.

SwiftUI: Padding

Padding

Padding automatically adds 16px for each side.

Perhaps the padding is a bit large. Try changing the padding to 10px.

You can just padding to the left.

You change your mind again and want the padding to the left and right.

You can do something a little different.

Thank you for following the next post, hope it will help.

Source: Internet.

Share the news now

Source : Viblo