This is a Xamarin Android Binding for the tooltips.
This project provides you a convenient way and simple to use library for android, enabling to add a tooltip near any view with ease.
Install NuGet package.
Create a ToolTipsManager
.
_toolTipsManager = new ToolTipsManager(this);
Use the ToolTip.Builder
to create and position your Tooltip.
builder = new ToolTip.Builder(
this,
_textView, /* anchor view */
_rootLayout, /* root view of entire layout, must be a RelativeLayout or FrameLayout. */
text, /* tooltip text */
ToolTip.PositionAbove); /* Position related to achor view */
builder.SetAlign(_align); /* arrow align */
_toolTipsManager.Show(builder.Build());
If you want to how the tooltip immediately when the Activity
is created you should Build and show the tooltip in the OnWindowsFocusChanged
method, example:
public override void OnWindowFocusChanged(bool hasFocus)
{
base.OnWindowFocusChanged(hasFocus);
builder = new ToolTip.Builder(
this,
_textView, /* anchor view */
_rootLayout, /* root view of entire layout, must be a RelativeLayout or FrameLayout. */
text, /* tooltip text */
ToolTip.PositionAbove); /* Position related to achor view */
builder.SetAlign(_align); /* arrow align */
_toolTipsManager.Show(builder.Build());
}
In alternative you could use View.Post
or View.PostDelayed
in OnCreate
.
Run and play with the sample.
Read more detailed documention original library project.