Declaration
compose().autocorrectionDisabled(disable?: boolean)@export(implementation) nonisolated func autocorrectionDisabled(
_ disable: Bool = true
) -> some ViewParameters
disablebooleanA Boolean value that indicates whether autocorrection is disabled for this view. The default value is
true.
Discussion
Use this method when the effect of autocorrection would make it more difficult for the user to input information. The entry of proper names and street addresses are examples where autocorrection can negatively affect the user's ability complete a data entry task.
The example below configures a TextField with the default
keyboard. Disabling autocorrection allows the user to enter arbitrary
text without the autocorrection system offering suggestions or
attempting to override their input.
TextField("1234 Main St.", text: $address)
.keyboardType(.default)
.autocorrectionDisabled(true)See also
More in Text and symbols.
- allowsTighteningSets whether text in this view can compress the space between characters when necessary to fit text in a line.
- baselineOffsetSets the vertical offset for the text relative to its baseline in this view.
- boldApplies a bold font weight to the text in this view.
- findDisabledPrevents find and replace operations in a text editor.
- findNavigatorProgrammatically presents the find and replace interface for text editor views.
- fontSets the default font for text in this view.
- fontDesignSets the font design of the text in this view.
- fontWeightSets the font weight of the text in this view.
- fontWidthSets the font width of the text in this view.
- interactionActivityTrackingTagSets a tag that you use for tracking interactivity.
- italicApplies italics to the text in this view.
- kerningSets the spacing, or kerning, between characters for the text in this view.