how to display ToolTip in android?

后端 未结 11 1236
情书的邮戳
情书的邮戳 2020-12-17 09:04

I want to display the ToolTip(QuickAction View) when I am moving my cursor on the view. Can any one please give me the simple example for it? tooltip will only contains the

11条回答
  •  南笙
    南笙 (楼主)
    2020-12-17 09:49

    I will Happy to help you

    Please sir Try this -> android-simple-tooltip

    I hope that will work for you

    Example : Release Add it in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }
    

    Add the dependency

    dependencies {
        implementation 'com.github.douglasjunior:android-simple-tooltip:0.2.3'
    }
    

    Add this code in your MainActivity class and make an object for your view which will you want to bind with tooltip

    View yourView = findViewById(R.id.your_view);
    
        new SimpleTooltip.Builder(this)
            .anchorView(yourView)
            .text("Texto do Tooltip")
            .gravity(Gravity.END)
            .animated(true)
            .transparentOverlay(false)
            .build()
            .show();
    

提交回复
热议问题