语言

IInputConnection.DeleteSurroundingTextInCodePoints(Int32, Int32) 方法

定义

的变体。#deleteSurroundingText(int, int)

[Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public bool DeleteSurroundingTextInCodePoints(int beforeLength, int afterLength);
[<Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member DeleteSurroundingTextInCodePoints : int * int -> bool

参数

beforeLength
Int32

要删除的游标之前的字符数,以代码点表示。 如果这大于文本开头和游标之间的现有字符数,则此方法不会失败,而是删除该范围中的所有字符。

afterLength
Int32

要删除的游标后的字符数(以代码点为单位)。 如果这大于光标和文本末尾之间的现有字符数,则此方法不会失败,而是删除该区域中的所有字符。

返回

true 如果输入连接不再有效, false 则为“成功”。 在 Android android.os.Build.VERSION_CODES#TIRAMISU之前,当目标应用程序未实现此方法时,将返回 false 此 API。

特性

注解

的变体。#deleteSurroundingText(int, int) 主要区别包括:

<ul><li>长度以代码点提供,而不是以字符或字形Java提供。</><li>如果请求范围中有一个或多个无效的代理项对,则此方法不执行任何操作。</li></ul>

编辑作者: 除了要求之外 #deleteSurroundingText(int, int),请确保在请求的范围中找到一个矿石无效的代理项对时不执行任何操作。

Java文档android.view.inputmethod.InputConnection.deleteSurroundingTextInCodePoints(int, int)。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于