using System;
|
using UIKit;
|
using CoreGraphics;
|
|
namespace Shared
|
{
|
/// <summary>
|
/// 信息提示
|
/// </summary>
|
public class Tip
|
{
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
public Tip()
|
{
|
this.BackgroundColor = 0xff323232;
|
}
|
/// <summary>
|
/// 关闭时间
|
/// </summary>
|
/// <value>The close time.</value>
|
public int CloseTime {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 提示内容
|
/// </summary>
|
/// <value>The text.</value>
|
public string Text {
|
get;
|
set;
|
}
|
|
/// <summary>
|
/// 文字提示方向
|
/// </summary>
|
/// <value>The direction.</value>
|
public AMPopTipDirection Direction {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 最大宽度
|
/// </summary>
|
/// <value>The width of the max.</value>
|
public int MaxWidth {
|
get;
|
set;
|
}
|
|
/// <summary>
|
/// 背景颜色
|
/// </summary>
|
/// <value>The color of the background.</value>
|
public uint BackgroundColor {
|
get;
|
set;
|
}
|
|
|
/// <summary>
|
/// 点击哪个View时显赫提示
|
/// </summary>
|
public void Show(View view)
|
{
|
var popTip= AMPopTip.PopTip ();
|
popTip.PopoverColor = new UIKit.UIColor(((this.BackgroundColor >> 16) & 0xff)/255.0f, ((this.BackgroundColor >> 8) & 0xFF)/255.0f, (this.BackgroundColor & 0xFF)/255.0f, ((this.BackgroundColor >> 24) & 0xFF)/255.0f);
|
popTip.ShowText (this.Text,Direction,MaxWidth, Application.RootFrameLayout, view.RealView.ConvertRectToView(view.RealView.Bounds,Application.RootFrameLayout),CloseTime);
|
}
|
|
|
}
|
|
}
|