本文整理汇总了C#中Android.Widget.TextView.SetIncludeFontPadding方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.SetIncludeFontPadding方法的具体用法?C# TextView.SetIncludeFontPadding怎么用?C# TextView.SetIncludeFontPadding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Widget.TextView
的用法示例。
在下文中一共展示了TextView.SetIncludeFontPadding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
void Initialize ()
{
BackgroundColor = Color.Black;
strokeColor = Color.White;
StrokeWidth = 2f;
canvasView = new SignatureCanvasView (this.context);
canvasView.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent);
//Set the attributes for painting the lines on the screen.
paint = new Paint ();
paint.Color = strokeColor;
paint.StrokeWidth = StrokeWidth;
paint.SetStyle (Paint.Style.Stroke);
paint.StrokeJoin = Paint.Join.Round;
paint.StrokeCap = Paint.Cap.Round;
paint.AntiAlias = true;
#region Add Subviews
RelativeLayout.LayoutParams layout;
BackgroundImageView = new ImageView (this.context);
BackgroundImageView.Id = generateId ();
AddView (BackgroundImageView);
//Add an image that covers the entire signature view, used to display already drawn
//elements instead of having to redraw them every time the user touches the screen.
imageView = new ClearingImageView (context);
imageView.SetBackgroundColor (Color.Transparent);
imageView.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent);
AddView (imageView);
lblSign = new TextView (context);
lblSign.Id = generateId ();
lblSign.SetIncludeFontPadding (true);
lblSign.Text = "Sign Here";
layout = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent);
layout.AlignWithParent = true;
layout.BottomMargin = 6;
layout.AddRule (LayoutRules.AlignBottom);
layout.AddRule (LayoutRules.CenterHorizontal);
lblSign.LayoutParameters = layout;
lblSign.SetPadding (0, 0, 0, 6);
AddView (lblSign);
//Display the base line for the user to sign on.
signatureLine = new View (context);
signatureLine.Id = generateId ();
signatureLine.SetBackgroundColor (Color.Gray);
layout = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, 1);
layout.SetMargins (10, 0, 10, 5);
layout.AddRule (LayoutRules.Above, lblSign.Id);
signatureLine.LayoutParameters = layout;
AddView (signatureLine);
//Display the X on the left hand side of the line where the user signs.
xLabel = new TextView (context);
xLabel.Id = generateId ();
xLabel.Text = "X";
xLabel.SetTypeface (null, TypefaceStyle.Bold);
layout = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent);
layout.LeftMargin = 11;
layout.AddRule (LayoutRules.Above, signatureLine.Id);
xLabel.LayoutParameters = layout;
AddView (xLabel);
AddView (canvasView);
lblClear = new TextView (context);
lblClear.Id = generateId ();
lblClear.Text = "Clear";
layout = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent);
layout.SetMargins (0, 10, 22, 0);
layout.AlignWithParent = true;
layout.AddRule (LayoutRules.AlignRight);
layout.AddRule (LayoutRules.AlignTop);
lblClear.LayoutParameters = layout;
lblClear.Visibility = ViewStates.Invisible;
lblClear.Click += (object sender, EventArgs e) => {
Clear ();
};
AddView (lblClear);
#endregion
paths = new List<Path> ();
points = new List<System.Drawing.PointF[]> ();
currentPoints = new List<System.Drawing.PointF> ();
dirtyRect = new RectF ();
}