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


C# EditText.SetWidth方法代码示例

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


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

示例1: OnCreateOptionsMenu

		public override bool OnCreateOptionsMenu (Android.Views.IMenu menu)
		{
			MenuInflater.Inflate (Resource.Menu.main_screen, menu);

			_addAlarmMenuButton = menu.FindItem (Resource.Id.add_alarm);
			_acceptMenuButton = menu.FindItem (Resource.Id.accept);
			_alarmNameMenuItem = menu.FindItem (Resource.Id.alarm_name);
			_deleteAlarmMenuItem = menu.FindItem (Resource.Id.delete);
			_disableAlarmMenuItem = menu.FindItem (Resource.Id.switch_button);
			_alarmRadiusMenuItem = menu.FindItem (Resource.Id.alarm_radius);
			_settingsMenuItem = menu.FindItem (Resource.Id.action_settings);
            
			_alarmNameEditText = MenuItemCompat.GetActionView (_alarmNameMenuItem) as EditText;
			_alarmNameEditText.Hint = Resources.GetString (Resource.String.alarm_name);
			_alarmNameEditText.SetWidth (Resources.GetDimensionPixelSize (Resource.Dimension.abc_search_view_preferred_width));

			_enableAlarmToggleButton = MenuItemCompat.GetActionView (_disableAlarmMenuItem) as ToggleButton;
			_enableAlarmToggleButton.CheckedChange += AlarmEnabledChange;

			_alarmRadiusSpinner = MenuItemCompat.GetActionView (_alarmRadiusMenuItem) as Spinner;
			var adapter = new ArrayAdapter (this, Resource.Layout.support_simple_spinner_dropdown_item, 
				              Android.Resource.Id.Text1, Constants.AlarmRadiusValues.Select (r => string.Format ("{0} m", r)).ToList ());
			adapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
			_alarmRadiusSpinner.Adapter = adapter;
			_alarmRadiusSpinner.ItemSelected += (s, e) => RedrawAddCircle ();

			ManageMenuItemsVisibilityForMode ();

			_addAlarmMenuButton.SetVisible (_isGooglePlayServicesAvailable == ConnectionResult.Success);

			return base.OnCreateOptionsMenu (menu);
		}
开发者ID:foxanna,项目名称:SimpleLocationAlarm,代码行数:32,代码来源:HomeActivityAddMode.cs

示例2: GetPropertyWindowLayout


//.........这里部分代码省略.........
			text3.Adapter = dataadapter1;

			text3.ItemSelected+= (object sender, AdapterView.ItemSelectedEventArgs e) => {
				String selectedItem = dataadapter1.GetItem(e.Position);
									if (selectedItem.Equals("Suggest")) {
										autoCompleteMode = AutoCompleteMode.Suggest;
										
									} else if (selectedItem.Equals("SuggestAppend")) {
										autoCompleteMode = AutoCompleteMode.SuggestAppend;
										
									} else if (selectedItem.Equals("Append")) {
										autoCompleteMode = AutoCompleteMode.Append;
										
									}
			};

			//Separator 2
			SeparatorView separate1 = new SeparatorView(context, width * 2);
			separate1.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);

			LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(
				width * 2, 5);
			layoutParams2.SetMargins(0, 20, 0, 0);
			propertylayout.SetPadding(15, 0, 15, 0);

			//Separator 2
			SeparatorView separate2 = new SeparatorView(context, width * 2);
			separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			propertylayout.AddView(separate2, layoutParams2);

			//Min Prefix Character
			TextView textView7 = new TextView(context);
			textView7.Text = "Min Prefix Character";
			textView7.SetWidth(400);
			textView7.TextSize=20;
			etext1 = new EditText(context);
			etext1.Text = "1";
			etext1.TextSize=16;
			etext1.InputType = Android.Text.InputTypes.ClassPhone;
			etext1.TextChanged+= (object sender, Android.Text.TextChangedEventArgs e) => 
			{
				if(etext1.Text.Length > 0)
					minimum =  Convert.ToInt32(e.Text.ToString());
				else
					minimum = 1;
			};

			LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			layoutParams7.SetMargins(0, 10, 0, 0);
			LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.WrapContent, 55);
			layoutParams8.SetMargins(0, 10, 0, 0);
			stackView2 = new LinearLayout(context);
			stackView2.AddView(textView7,layoutParams8);
			stackView2.AddView(etext1, layoutParams7);
			stackView2.Orientation = Orientation.Horizontal;
			propertylayout.AddView(stackView2);
			SeparatorView separate4 = new SeparatorView(context, width * 2);
			separate4.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(width * 2, 5);
			layoutParams6.SetMargins(0, 20, 15, 0);
			propertylayout.AddView(separate4, layoutParams6);

			//max DropDown height
			TextView textView8 = new TextView(context);
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:67,代码来源:AutoComplete.cs


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