using System;
|
namespace Shared.Phone.Device.CommonForm
|
{
|
/// <summary>
|
/// 图片在左边,文字在右边,带下划线的行控件
|
/// </summary>
|
public class LeftIconButtonRowLayout:FrameLayout
|
{
|
#region ◆ 变量__________________________
|
/// <summary>
|
/// 图片
|
/// </summary>
|
public Button iconButton;
|
/// <summary>
|
/// 标题
|
/// </summary>
|
public Button titleButton;
|
/// <summary>
|
/// 下划线
|
/// </summary>
|
public FrameLayout lineFrameLayout;
|
|
#endregion
|
|
#region ◆ 构造方法_______________________
|
|
public LeftIconButtonRowLayout()
|
{
|
|
}
|
|
#endregion
|
|
#region ◆ 初始化__________________________
|
|
/// <summary>
|
/// 初始化--部分参数先写死吧
|
/// </summary>
|
/// <param name="iconPath">Icon path.</param>
|
/// <param name="iconSelectedPath">Icon selected path.</param>
|
/// <param name="title">Title.</param>
|
public void Init(string iconPath, string iconSelectedPath, string title)
|
{
|
iconButton = new Button()
|
{
|
X = Application.GetRealWidth(80),
|
Height = Application.GetMinRealAverage(80),
|
Width = Application.GetMinRealAverage(80),
|
UnSelectedImagePath = iconPath,
|
SelectedImagePath = iconSelectedPath,
|
Gravity = Gravity.CenterVertical,
|
Tag = this.Tag
|
};
|
AddChidren(iconButton);
|
|
titleButton = new Button()
|
{
|
X = iconButton.Right+Application.GetRealWidth(30),
|
Height = Application.GetRealHeight(80),
|
Width = this.Width - Application.GetRealWidth(80+80+30),
|
TextColor=Shared.Common.ZigbeeColor.Current.GXCPlaceHolderTextColor,
|
SelectedTextColor=Common.ZigbeeColor.Current.GXCACSelectedTextColor,
|
Text=title,
|
TextAlignment=TextAlignment.CenterLeft,
|
Gravity = Gravity.CenterVertical,
|
Tag = this.Tag
|
};
|
AddChidren(titleButton);
|
|
lineFrameLayout = new FrameLayout()
|
{
|
X = iconButton.X,
|
Y = this.Height - 1,
|
Width = this.Width - iconButton.X,
|
Height = 1,
|
BackgroundColor = Common.ZigbeeColor.Current.GXCPlaceHolderTextColor
|
};
|
AddChidren(lineFrameLayout);
|
|
}
|
#endregion
|
|
}
|
}
|