MeasuredText.Builder.AppendReplacementRun(Paint, Int32, Single) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Used to inform the text layout that the given length is replaced with the object of given width.
[Android.Runtime.Register("appendReplacementRun", "(Landroid/graphics/Paint;IF)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=29)]
public Android.Graphics.Text.MeasuredText.Builder AppendReplacementRun(Android.Graphics.Paint paint, int length, float width);
[<Android.Runtime.Register("appendReplacementRun", "(Landroid/graphics/Paint;IF)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=29)>]
member this.AppendReplacementRun : Android.Graphics.Paint * int * single -> Android.Graphics.Text.MeasuredText.Builder
Parameters
- paint
- Paint
The non-null paint used for the replacement run.
- length
- Int32
The positive number of UTF-16 code units to replace, starting at the current offset. The run must not extend past the end of the paragraph.
- width
- Single
a replacement width of the range. The units of this value are pixels. Value is 0.0f or greater
Returns
This builder instance, with its current offset advanced by length UTF-16 code units.
- Attributes
Remarks
Used to inform the text layout that the given length is replaced with the object of given width. Keeps an internal offset which increases at every append. The initial value for this offset is zero. After the style is applied the internal offset is moved to offset + length, and next call will start from this new position. Informs the layout engine that the given length should not be processed, instead the provided width should be used for calculating the width of that range.
Style and replacement runs must together cover the complete paragraph before Build() is called. The replacement's width is supplied by the caller; this method does not draw the replacement object.
For the run-length checks, see the Android 16 implementation.
Android reference for android.graphics.text.MeasuredText.Builder.appendReplacementRun.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.