using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone.UserCenter
{
///
/// EditText的共通,共有的方法写在里面
///
public class EditInputTextCommon : EditText
{
///
/// 向上的偏差值
///
public int DeviationValue = Application.GetRealHeight(10);
///
/// 初始化(初始值:标准字体颜色,文字向左靠齐)
///
public EditInputTextCommon()
{
//测试,全体输入框为14号字
this.TextSize = 14;
this.TextColor = UserCenterColor.Current.TextColor;
this.TextAlignment = TextAlignment.CenterLeft;
}
///
/// 初始化控件大小(不以平均值进行真实数值计算)
///
/// 宽度
/// 高度
/// 是否计算真实值
public void InitSize(int i_Width, int i_Height, bool real = true)
{
if (real == true)
{
i_Width = Application.GetRealWidth(i_Width);
i_Height = Application.GetRealHeight(i_Height);
}
this.Height = i_Height;
this.Width = i_Width;
}
///
/// 初始化控件大小(不以平均值进行真实数值计算)
///
/// 宽度
/// 是否计算真实值
public void InitSize(int i_Width, bool real = true)
{
if (real == true)
{
i_Width = Application.GetRealWidth(i_Width);
}
this.Height = ControlCommonResourse.NormalControlHeight;
this.Width = i_Width;
}
///
/// 初始化控件大小(以平均值进行真实数值计算)
///
/// 宽度
/// 高度
/// 是否计算真实值
public void InitAvgSize(int i_Width, int i_Height, bool real = true)
{
if (real == true)
{
i_Width = Application.GetMinRealAverage(i_Width);
i_Height = Application.GetMinRealAverage(i_Height);
}
this.Height = i_Height;
this.Width = i_Width;
}
///
/// Y轴重置(真实数值,没有父容器无效)
///
/// 上下对齐方式
/// 上下两部分的间距
public void ReSetYaxis(UViewAlignment alignment, int Space = 0)
{
if (this.Parent == null)
{
return;
}
//Y轴重置
this.Y = UserCenterLogic.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space);
}
}
///
/// 输入框控件
///
public class EditInputText : EditInputTextCommon
{
}
}