FUIRatingControlContentView
@MainActor
open class FUIRatingControlContentView : FUIFormCellContentView<FUIRatingControl, FUIControlState, FUIText>, FUITitleComponent, FUIPropertyFormCell, FUISubtitleComponent
This is the content view of the FUIRatingControlFormCell.
This view includes a FUITextKitView for title, a FUIRatingControl for the rating control,
and another FUITextKitView for subtitle. When subtitle is not nil, the title will not
be displayed.
-
The key name of the property.
Declaration
Swift
@MainActor open var keyName: String? { get set } -
The type of value is
Intfor theFUIRatingControlFormCell.Declaration
Swift
public typealias ValueType = Int -
Indicates if the value of the cell could be changed or not.
The default is
true.Declaration
Swift
@MainActor open var isEditable: Bool { get set } -
Implementation of change handler.
This is invoked when user changed the rating.
Declaration
Swift
@MainActor open var onChangeHandler: ((Int) -> Void)? -
The value of the property represents the rating.
The value should be in the
ratingBoundsof theratingControlproperty.Declaration
Swift
@MainActor public var value: Int { get set } -
The optional average rating value of this
FUIRatingControl, in both standard and accented styles, can display half-stars. Theratingvalue is used when the average rating value is nil in these styles.If the decimal part of the average rating value is between 0.3 and 0.7, inclusive, a half-star will be displayed. For example, 0.6 will be rounded to 0.5, 0.2 will be rounded to 0, and 0.8 will be rounded to 1.
- Setting this value below the lower bound of
ratingBoundswill be interpreted as setting it to the lower bound ofratingBounds.
Declaration
Swift
@MainActor public var averageValue: Float? { get set } - Setting this value below the lower bound of
-
The
FUIRatingControlin this view.Declaration
Swift
@MainActor public var ratingControl: FUIRatingControl { get } -
Truncates the text of the key label if appropriate.
This property indicates if the key label text should be truncated or not when the width of the cell cannot hold the key name label and the ratings in the same line.
The default value is true. It means that the key name will be truncated in the end, and the label and the rating will be in a single horizontal line. Otherwise, the rating will be pushed to the line below the label.
Note that this property is ignored for device accessibility size larger than xxx large. In that case, the rating stars will always be in a separate line than the key label.
Declaration
Swift
@MainActor public var truncatesKeyLabel: Bool -
Wraps the text of the key label if appropriate.
This property indicates whether the key label text should be wrapped when the cell width cannot hold both the key name label and the ratings on the same line. the cell cannot hold the key name label and the ratings in the same line.
The default value is false, so the key name will not be wrapped, and the label and rating will be positioned according to the
truncatesKeyLabelproperty. If thewrapsKeyLabelproperty is set to true, the label will be allowed to wrap, and the label and rating control will be on a single line. In this case, thetruncatesKeyLabelproperty will be ignored.Declaration
Swift
@MainActor public var wrapsKeyLabel: Bool -
The maximum number of images displayed in a wrapped item row.
When the
wrapsKeyLabelproperty is set to true and the device’s Larger Accessibility Size is eitheraccessibilityExtraExtraLargeoraccessibilityExtraExtraExtraLarge, the rating image items will automatically wrap to multiple lines. This property limits the maximum number of images per row. Remaining images will be displayed on the following lines.The default is
3. The value should be between 1 toratingBounds.count- 1Declaration
Swift
@MainActor public var maxItemsPerWrapRow: Int { get set }