Sets the transparency of this view.
- iOS 13.0+Beta
- macOS 10.15+Beta
- Mac Catalyst 13.0+Beta
- tvOS 13.0+Beta
- watchOS 6.0+Beta
- Xcode 11.0+Beta
A value between 0 (fully transparent) and 1 (fully opaque).
A view that sets the transparency of this view.
Apply opacity to reveal views that are behind another view or to de-emphasize a view. The following shows two versions of the same image side by side; at left is the original, and at right is a duplicate with its opacity set to 0.5:
When applying the
opacity(_:) modifier to a view that already has an opacity, the modifier supplements—rather than replaces—the view’s opacity.