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


C# UILabel.Right方法代码示例

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


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

示例1: ShowView

		private void ShowView(){
		
			var startDate = (new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds (VTSModelTmp.VTSModel.StartDate).ToLocalTime ();
			var endDate = (new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds (VTSModelTmp.VTSModel.EndDate).ToLocalTime (); 

			_vacationType = new UILabel ();
			_vacationType.Text = VTSModelTmp.VTSModel.VacationType;
			View.Add (_vacationType);

			_vacationStartDate = new UILabel ();
			_vacationStartDate.Text = _localizer.Localize("startDate");
			View.Add (_vacationStartDate);

			_vacationStartDateBtn = new UIButton ();
			_vacationStartDateBtn.SetTitle(startDate.ToString("d"), UIControlState.Normal);
			_vacationStartDateBtn.SetTitleColor(UIColor.Blue, UIControlState.Normal);
			View.Add (_vacationStartDateBtn);

			_vacationEndDate = new UILabel ();
			_vacationEndDate.Text = _localizer.Localize("endDate");
			View.Add (_vacationEndDate);

			_vacationEndDateBtn = new UIButton ();
			_vacationEndDateBtn.SetTitle(endDate.ToString("d"), UIControlState.Normal);
			_vacationEndDateBtn.SetTitleColor(UIColor.Blue, UIControlState.Normal);
			View.Add (_vacationEndDateBtn);

			_vacationStatusTitle = new UILabel ();
			_vacationStatusTitle.Text = _localizer.Localize("status");
			View.Add (_vacationStatusTitle);

			_vacationStatus = new UILabel ();
			_vacationStatus.Text = _localizer.Localize("cancelled");
			View.Add (_vacationStatus);

			_vacationError = new UILabel ();
			_vacationError.Text = "";
			//_vacationError.Text = _localizer.Localize("dateError");
			_vacationError.LineBreakMode = UILineBreakMode.WordWrap;
			_vacationError.Lines = 0;  
			_vacationError.TextColor = UIColor.Red;
			View.Add (_vacationError);

			_vacationPickImageFromGallery = new UIButton ();
			_vacationPickImageFromGallery.SetTitle(_localizer.Localize("pickImgFromGallery"), UIControlState.Normal);
			_vacationPickImageFromGallery.SetTitleColor(UIColor.Blue, UIControlState.Normal);
			View.Add (_vacationPickImageFromGallery);

			_vacationImageView = new UIImageView ();
			if (VTSModelTmp.VTSModel.Image != null) {
				NSData imageData = NSData.FromArray(VTSModelTmp.VTSModel.Image); 
				_vacationImageView.Image = UIImage.LoadFromData(imageData); 
			}
			View.Add (_vacationImageView);

			_vacationUpdateBtn = new UIButton ();
			_vacationUpdateBtn.SetTitle(_localizer.Localize("update"), UIControlState.Normal);
			_vacationUpdateBtn.SetTitleColor(UIColor.Blue, UIControlState.Normal);
			View.Add (_vacationUpdateBtn);


			View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints ();

			var screen = UIScreen.MainScreen.Bounds;
			var screenWidth = (float)screen.Width;
			var screenHeight = (float)screen.Height;

			View.AddConstraints (
				_vacationType.Top().EqualTo().TopOf(View).Plus(screenHeight/5),
				_vacationType.CenterX().EqualTo().CenterXOf(View),

				_vacationStartDate.Top().EqualTo().BottomOf(_vacationType).Plus(10),
				_vacationStartDate.CenterX().EqualTo().CenterXOf(View).Minus(70),
				_vacationStartDate.Left().EqualTo().LeftOf(View).Plus(5),

				_vacationStartDateBtn.Top().EqualTo().BottomOf(_vacationType).Plus(3),
				_vacationStartDateBtn.Right().EqualTo().RightOf(View).Minus(5),

				_vacationEndDate.Top().EqualTo().BottomOf(_vacationStartDateBtn).Plus(3),
				_vacationEndDate.CenterX().EqualTo().CenterXOf(View).Minus(70),
				_vacationEndDate.Left().EqualTo().LeftOf(View).Plus(5),

				_vacationEndDateBtn.Top().EqualTo().BottomOf(_vacationStartDateBtn).Minus(5),
				_vacationEndDateBtn.Right().EqualTo().RightOf(View).Minus(5),

				_vacationStatusTitle.Top().EqualTo().BottomOf(_vacationEndDate).Plus(10),
				_vacationStatusTitle.CenterX().EqualTo().CenterXOf(View).Minus(50),
				_vacationStatusTitle.Left().EqualTo().LeftOf(View).Plus(5),

				_vacationStatus.Top().EqualTo().BottomOf(_vacationEndDateBtn).Plus(4),
				_vacationStatus.Right().EqualTo().RightOf(View).Minus(5)
			);

			if (VTSModelTmp.VTSModel.Status != "greenCircle.png") {

				View.AddConstraints (
					_vacationUpdateBtn.Top().EqualTo().BottomOf(_vacationStatusTitle),
					_vacationUpdateBtn.CenterX().EqualTo().CenterXOf(View),

					_vacationError.Top().EqualTo().BottomOf(_vacationUpdateBtn),
//.........这里部分代码省略.........
开发者ID:dtimyr,项目名称:xamarin,代码行数:101,代码来源:EditViewController.cs


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