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


C# EditText.SetEms方法代码示例

本文整理汇总了C#中EditText.SetEms方法的典型用法代码示例。如果您正苦于以下问题:C# EditText.SetEms方法的具体用法?C# EditText.SetEms怎么用?C# EditText.SetEms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EditText的用法示例。


在下文中一共展示了EditText.SetEms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

		public static View Create (Context context)
		{
			GridLayout p = new GridLayout(context);
			p.UseDefaultMargins = true;
			p.AlignmentMode = GridAlign.Bounds;
			Configuration configuration = context.Resources.Configuration;
			if ((configuration.Orientation == Android.Content.Res.Orientation.Portrait)) {
				p.ColumnOrderPreserved = false;
			} else {
				p.RowOrderPreserved = false;
			}

			//FIXME https://bugzilla.xamarin.com/show_bug.cgi?id=14210
			GridLayout.Spec titleRow              = GridLayout.InvokeSpec (0);
			GridLayout.Spec introRow              = GridLayout.InvokeSpec (1);
			GridLayout.Spec emailRow              = GridLayout.InvokeSpec (2, GridLayout.Baseline);
			GridLayout.Spec passwordRow           = GridLayout.InvokeSpec (3, GridLayout.Baseline);
			GridLayout.Spec button1Row            = GridLayout.InvokeSpec (5);
			GridLayout.Spec button2Row            = GridLayout.InvokeSpec (6);

			GridLayout.Spec centerInAllColumns    = GridLayout.InvokeSpec (0, 4, GridLayout.Center);
			GridLayout.Spec leftAlignInAllColumns = GridLayout.InvokeSpec (0, 4, GridLayout.Left);
			GridLayout.Spec labelColumn           = GridLayout.InvokeSpec (0, GridLayout.Right);
			GridLayout.Spec fieldColumn           = GridLayout.InvokeSpec (1, GridLayout.Left);
			GridLayout.Spec defineLastColumn      = GridLayout.InvokeSpec (3);
			GridLayout.Spec fillLastColumn        = GridLayout.InvokeSpec (3, GridLayout.Fill);

			{
				TextView c = new TextView (context);
				c.TextSize = 32;
				c.Text = "Email setup";
				p.AddView (c, new GridLayout.LayoutParams (titleRow, centerInAllColumns));
			}
			{
				TextView c = new TextView (context);
				c.TextSize = 16;
				c.Text = "You can configure email in a few simple steps:";
				p.AddView (c, new GridLayout.LayoutParams (introRow, leftAlignInAllColumns));
			}
			{
				TextView c = new TextView (context);
				c.Text = "Email address:";
				p.AddView (c, new GridLayout.LayoutParams (emailRow, labelColumn));
			}
			{
				EditText c = new EditText (context);
				c.SetEms (10);
				c.InputType = Android.Text.InputTypes.ClassText | Android.Text.InputTypes.TextVariationEmailAddress;
				p.AddView (c, new GridLayout.LayoutParams (emailRow, fieldColumn));
			}
			{
				TextView c = new TextView (context);
				c.Text = "Password:";
				p.AddView (c, new GridLayout.LayoutParams (passwordRow, labelColumn));
			}
			{
				TextView c = new EditText (context);
				c.SetEms (8);
				c.InputType = Android.Text.InputTypes.ClassText | Android.Text.InputTypes.TextVariationPassword;
				p.AddView (c, new GridLayout.LayoutParams (passwordRow, fieldColumn));
			}
			{
				Button c = new Button (context);
				c.Text = "Manual setup";
				p.AddView (c, new GridLayout.LayoutParams (button1Row, defineLastColumn));
			}
			{
				Button c = new Button (context);
				c.Text ="Next";
				p.AddView (c, new GridLayout.LayoutParams (button2Row, fillLastColumn));
			}

			return p;
		}
开发者ID:rez1dent,项目名称:monodroid-samples,代码行数:74,代码来源:GridLayout3.cs


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