using System;
namespace Shared.Phone.Device.CommonForm
{
///
/// 图片在左边,文字在右边,带下划线的行控件
///
public class LeftIconButtonRowLayout:FrameLayout
{
#region ◆ 变量__________________________
///
/// 图片
///
public Button iconButton;
///
/// 标题
///
public Button titleButton;
///
/// 下划线
///
public FrameLayout lineFrameLayout;
#endregion
#region ◆ 构造方法_______________________
public LeftIconButtonRowLayout()
{
}
#endregion
#region ◆ 初始化__________________________
///
/// 初始化--部分参数先写死吧
///
/// Icon path.
/// Icon selected path.
/// Title.
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
}
}