Język

TextBoundsInfo.Builder.SetCharacterBounds(Single[]) Method

Definition

Set the characters bounds, in the coordinates of the editor.

[Android.Runtime.Register("setCharacterBounds", "([F)Landroid/view/inputmethod/TextBoundsInfo$Builder;", "", ApiSince=34)]
public Android.Views.InputMethods.TextBoundsInfo.Builder SetCharacterBounds(float[] characterBounds);
[<Android.Runtime.Register("setCharacterBounds", "([F)Landroid/view/inputmethod/TextBoundsInfo$Builder;", "", ApiSince=34)>]
member this.SetCharacterBounds : single[] -> Android.Views.InputMethods.TextBoundsInfo.Builder

Parameters

characterBounds
Single[]

the array of the flattened character bounds. This value cannot be null.

Returns

Attributes

Remarks

Set the characters bounds, in the coordinates of the editor. The given array should be divided into groups of four where each element represents left, top, right and bottom of the character bounds respectively. The bounds of the i-th character in the editor should be stored at index 4 * (i - start). The length of the given array must equal to 4 * (end - start). Sometimes multiple characters in a single grapheme are rendered as one symbol on the screen. So those characters only have one shared bounds. In this case, we recommend the editor to assign all the width to the bounds of the first character in the grapheme, and make the rest characters' bounds zero-width. For example, the string "'0xD83D' '0xDE00'" is rendered as one grapheme - a grinning face emoji. If the bounds of the grapheme is: Rect(5, 10, 15, 20), the character bounds of the string should be: [ Rect(5, 10, 15, 20), Rect(15, 10, 15, 20) ].

Android reference for android.view.inputmethod.TextBoundsInfo.Builder.setCharacterBounds.

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.

Applies to