跳转至
Enumeration

RoundedCornerStyle

Defines the shape of a rounded rectangle's corners.

Declaration

enum RoundedCornerStyle

Overview

This rectangular corner style has two options:

  1. circular: The corners are quarter circles or ovals
  2. continuous: The corners are smooth

These styles have subtle but noticeable differences:

struct ContentView: View {
    var body: some View {
        VStack(spacing: 20) {
            RoundedRectangle(cornerRadius: 50, style: RoundedCornerStyle.circular)
                .frame(width: 250, height: 150)

            RoundedRectangle(cornerRadius: 50, style: RoundedCornerStyle.continuous)
                .frame(width: 250, height: 150)
        }
    }
}
A screenshot displaying two black rectangles with rounded corners stacked on top of each other, with empty space in between. The top rectangle has 'circular' corners, while the bottom has 'continuous', or smooth corners.

Availability

iOS 13.0+

macOS 10.15+

tvOS 13.0+

watchOS 6.0+

Topics


Case

circular Quarter-circle rounded rectangle corners.

continuous Continuous curvature rounded rect corners.


Type Method

==(a:b:) Returns a Boolean value indicating whether two values are equal.


Instance Method

hash(into:) Hashes the essential components of this value by feeding them into the given hasher.


Instance Property

hashValue The hash value.