当前位置: 首页>>代码示例>>C#>>正文


C# TextView.SetIncludeFontPadding方法代码示例

本文整理汇总了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 ();
		}
开发者ID:ronrat,项目名称:SignaturePad,代码行数:90,代码来源:SignaturePadView.cs


注:本文中的Android.Widget.TextView.SetIncludeFontPadding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。