RecyclerView中的项目中的工具提示(与项目重叠) [英] Tooltip in Items within RecyclerView (Overlap above items)

查看:62
本文介绍了RecyclerView中的项目中的工具提示(与项目重叠)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建具有多个ViewTypesRecyclerView.但是,在某些项目上,我需要显示一个Tooltip,该鼠标应悬停在上面的行上.

I need to create a RecyclerView with multiple ViewTypes. However, on some of the items, I need to display a Tooltip which should hover over the above row.

我的要求是:

在上图中,RecyclerView中有4个项目,并且下一行的工具提示应重叠在上一行(或根据需要的行)的顶部.该工具提示仅在某些情况下可见-当锁定图标可见时.

In the above image, there are 4 items in the RecyclerView, and the tooltip in the lower row should overlap on top of the above row (or rows, as required). This tooltip would only be visible in some scenarios - when the lock icon is visible.

问题是,如果我将此工具提示作为TextView添加到row_layout.xml,并以编程方式控制其可见性,则会增加该行的高度,并且不会与上述布局重叠.

The problem is, if I add this tooltip as a TextView to the row_layout.xml, and control it's visibility programmatically, it increases the height of that row and does not overlap onto the above layout.

如何使该视图悬停"在屏幕上?在上面的行中而不替换它们?

How can I get this view to "hover" over the above rows without displacing them?

如果您需要代码,我也可以编辑此问题并发布代码(但我认为这里可能没有必要).

If you require code, I can edit this question and post the code too (but I think it might not be necessary here).

推荐答案

您可以使用

You can make use of Android Tooltips library.

基于弹出窗口.

Simple to use customizable Android Tooltips library based on PopupWindow. This Tooltips does not require any custom layout. It works as PopupWindow.

dependencies {
    compile 'com.github.vihtarb:tooltip:0.1.9'
}

用法:

Tooltip tooltip = new Tooltip.Builder(anchorView)
    .setText("Hello tooltip")
    .show();

这篇关于RecyclerView中的项目中的工具提示(与项目重叠)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆