android - TapTarget.forBounds 的第一个参数是什么,它是什么意思 Rect

标签 android javers

我正在使用 Github 中的这个库来制作 TapTargetView 的序列

https://github.com/KeepSafe/TapTargetView

我想使用 TapTargetSequence 但我不知道链接下页中提供的 Sequence 示例中此“TapTarget.forBounds ”的第一个参数 并且不知道Rect的含义

关于这个图书馆

https://github.com/sjwall/MaterialTapTargetPrompt

我不知道如何对这个库进行排序

最佳答案

来源TapTargetView :

Each tap target describes a target via a pair of bounds and icon. The bounds dictate the location and touch area of the target, where the icon is what will be drawn within the center of the bounds.

您应该提供 Rect定义起点和要显示 View 的目标区域的对象。 (左、上、右、下)。

如何为 View 创建目标矩形的示例(view 是您的按钮):

int[] loc = new int[2];
view.getLocationOnScreen(loc);
Rect rect = new Rect(loc[0], loc[1], loc[0] + view.getWidth(), l[1] + view.getHeight());

关于android - TapTarget.forBounds 的第一个参数是什么,它是什么意思 Rect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40590609/

相关文章:

java - 如果数据库已在使用中,如何使用当前状态初始化 Javers jv_snapshot?

java - 如何从 Javers 中的影子元素获取版本

android - 15dp 是否代表每个设备中相同的物理尺寸(例如屏幕上的 7 毫米)? (安卓)

java - Putextra 不断发送第一个输入的数据

android - 从 Android 设备登录到 symfony

java - org.hibernate.LazyInitializationException : failed to lazily initialize a collection of role while using Javers

java - 如何自定义 Hibernate EnVers

android - 对非 SAF 内容的持久权限

android - Google Nexus 5 上的手电筒

java - 不推荐使用 QueryBuilder 类型中的方法 andProperty(String) - Javers