RatingControl
public struct RatingControl
extension RatingControl: View
extension RatingControl: _ViewEmptyChecking
RatingControl
uses images to represent a rating.
The number of “On” images denotes the rating. The default “On” image is a filled star while the default “Off” inmage is an unfilled star.
-
init(valueLabel:
onStarImage: offStarImage: halfStarImage: reviewCountLabel: rating: ratingControlStyle: ratingBounds: itemSize: interItemSpacing: ratingValueFormat: showsValueLabel: averageRating: averageRatingFormat: reviewCount: reviewCountFormat: reviewCountCeiling: reviewCountCeilingFormat: showsReviewCountLabel: ) Undocumented
Declaration
Swift
public init(@ViewBuilder valueLabel: () -> any View = { EmptyView() }, @ViewBuilder onStarImage: () -> any View, @ViewBuilder offStarImage: () -> any View, @ViewBuilder halfStarImage: () -> any View, @ViewBuilder reviewCountLabel: () -> any View = { EmptyView() }, rating: Binding<Int>, ratingControlStyle: RatingControl.Style = .editable, ratingBounds: ClosedRange<Int> = 0 ... 5, itemSize: CGSize? = nil, interItemSpacing: CGFloat? = nil, ratingValueFormat: String? = nil, showsValueLabel: Bool = false, averageRating: CGFloat? = nil, averageRatingFormat: String = "%.1f", reviewCount: Int? = nil, reviewCountFormat: String? = nil, reviewCountCeiling: Int? = nil, reviewCountCeilingFormat: String? = nil, showsReviewCountLabel: Bool = false)
-
The available styles for the
See moreRatingControl
.Declaration
Swift
enum Style
-
init(valueLabel:
onStarImage: offStarImage: halfStarImage: reviewCountLabel: rating: ratingControlStyle: ratingBounds: itemSize: interItemSpacing: ratingValueFormat: showsValueLabel: averageRating: averageRatingFormat: reviewCount: reviewCountFormat: reviewCountCeiling: reviewCountCeilingFormat: showsReviewCountLabel: ) Undocumented
Declaration
Swift
init(valueLabel: AttributedString? = nil, onStarImage: Image = FioriIcon.actions.favorite.renderingMode(.template).resizable(), offStarImage: Image = FioriIcon.actions.unfavorite.renderingMode(.template).resizable(), halfStarImage: Image = FioriIcon.actions.halfStar.renderingMode(.template).resizable(), reviewCountLabel: AttributedString? = nil, rating: Binding<Int>, ratingControlStyle: RatingControl.Style = .editable, ratingBounds: ClosedRange<Int> = 0 ... 5, itemSize: CGSize? = nil, interItemSpacing: CGFloat? = nil, ratingValueFormat: String? = nil, showsValueLabel: Bool = false, averageRating: CGFloat? = nil, averageRatingFormat: String = "%.1f", reviewCount: Int? = nil, reviewCountFormat: String? = nil, reviewCountCeiling: Int? = nil, reviewCountCeilingFormat: String? = nil, showsReviewCountLabel: Bool = false)
-
Undocumented
Declaration
Swift
init(_ configuration: RatingControlConfiguration)
-
Declaration
Swift
public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }