TextView.GetOffsetForPosition(Single, Single) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得最接近指定絕對位置的字元位移。
[Android.Runtime.Register("getOffsetForPosition", "(FF)I", "GetGetOffsetForPosition_FFHandler")]
public virtual int GetOffsetForPosition(float x, float y);
[<Android.Runtime.Register("getOffsetForPosition", "(FF)I", "GetGetOffsetForPosition_FFHandler")>]
abstract member GetOffsetForPosition : single * single -> int
override this.GetOffsetForPosition : single * single -> int
參數
- x
- Single
螢幕上一點的水平絕對位置
- y
- Single
螢幕上某點的垂直絕對位置
傳回
字元偏移量是指位置最接近指定位置的字元。 如果沒有版面配置,-1 回。
- 屬性
備註
取得最接近指定絕對位置的字元位移。 典型的使用情境是將 和 傳遞MotionEvent#getX()MotionEvent#getY()給此方法。
Java 文件 android.widget.TextView.getOffsetForPosition(float, float)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。