コード例 #1
0
		public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell)
		{
			context.SaveState();
			float r = 0;
			float g = 0;
			float b = 0;

			var gradient = new CGGradient(CGColorSpace.CreateDeviceRGB(), new float[] { r, g, b, 0.20f, r, g, b, 0.40f }, new float[] { 0, 1 });			
			context.DrawLinearGradient(gradient, new PointF(rect.Left, rect.Top), new PointF(rect.Left, rect.Bottom), CGGradientDrawingOptions.DrawsBeforeStartLocation);

			context.RestoreState();
		}
コード例 #2
0
		public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell)
		{
			context.SaveState();
					
			var backgroundColor = CellBackgroundColor;
			if (backgroundColor != null)
			{
				if (backgroundColor == UIColor.Clear)
					backgroundColor = UIColor.Brown;

				context.SetFillColorWithColor(backgroundColor.ColorWithAlpha(0.6f).CGColor);
				context.SetBlendMode(CGBlendMode.Overlay);
				context.FillRect(rect);
			}

			context.RestoreState();
		}
コード例 #3
0
		public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell)
		{
			var gradientFrame = rect;
			
			var shineFrame = gradientFrame;
			shineFrame.Y += 1;
			shineFrame.X += 1;
			shineFrame.Width -= 2;
			shineFrame.Height = (shineFrame.Height / 2);

			CGColorSpace colorSpace = CGColorSpace.CreateDeviceRGB();

			var gradient = new CGGradient(
			    colorSpace,
			    new float[] { 0f, 0f,0f, 0.70f, 
							  0f, 0f, 0f, 0.40f},
				new float[] { 0, 1 } );

			var shineGradient = new CGGradient(
			    colorSpace,
			    new float[] { 1f, 1f, 1f, 0.80f, 
							  1f, 1f, 1f, 0.10f},
				new float[] { 0, 1 } );
			
			if (Cell != null && Cell.Highlighted)
			{
				context.SetFillColorWithColor(HighlightColor.CGColor);
			}
			else
			{
				context.SetFillColorWithColor(CellBackgroundColor.CGColor);
			}
			context.FillRect(rect);
	
			context.DrawLinearGradient(gradient, new PointF(gradientFrame.Left, gradientFrame.Top), new PointF(gradientFrame.Left, gradientFrame.Bottom), CGGradientDrawingOptions.DrawsAfterEndLocation);		
			context.DrawLinearGradient(shineGradient, new PointF(shineFrame.Left, shineFrame.Top), new PointF(shineFrame.Left, shineFrame.Bottom), CGGradientDrawingOptions.DrawsAfterEndLocation);
		}
コード例 #4
0
		public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell)
		{
			CellBackgroundColor.SetFill();
			context.FillRect(rect);
		}
コード例 #5
0
		public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell)
		{
			context.DrawLinearGradient(gradient, new PointF(rect.Left, rect.Top), new PointF(rect.Left, rect.Bottom), CGGradientDrawingOptions.DrawsBeforeStartLocation);
			cell.ShouldDrawBorder = true;
		}
コード例 #6
0
		public DisabledCellView(UITableViewElementCell cell) : base(cell.Bounds)
		{		
			BackgroundColor = UIColor.Clear;
			Opaque = false;

			if(cell != null)
			{
				_Cell = cell;
				cell.TextLabel.TextColor = UIColor.Gray;
				Bounds = _Cell.CalculateInnerRect();
			}
		}
コード例 #7
0
		public UITableViewCellContentView(UITableViewElementCell cell) : base(cell.Bounds)
		{
			Cell = cell;

			Opaque = false;
		}
コード例 #8
0
ファイル: Element.cs プロジェクト: eiu165/MonoMobile.Views
		protected void SetVisible(UITableViewElementCell cell)
		{
			if (cell != null)
			{
				if (Section != null)
				{
					if (_Visible && !Section.Elements.Contains(this))
						Section.Insert(_OldRow, this);
					else
					{
						_OldRow = IndexPath.Row;
						Section.Remove(this);
					}
				}

				cell.SetNeedsDisplay();
			}
		}
コード例 #9
0
ファイル: Element.cs プロジェクト: eiu165/MonoMobile.Views
		protected void SetDisabled(UITableViewElementCell cell)
		{
			if (cell != null)
			{
				if (_DisabledCellView != null)
				{
					_DisabledCellView.RemoveFromSuperview();
					_DisabledCellView.Dispose();
					_DisabledCellView = null;
				}

				_DisabledCellView = new DisabledCellView(cell);
				cell.AddSubview(_DisabledCellView);
				cell.SetNeedsDisplay();
			}
		}
コード例 #10
0
ファイル: Element.cs プロジェクト: eiu165/MonoMobile.Views
		public virtual UITableViewElementCell NewCell()
		{
			var cell = new UITableViewElementCell(Theme.CellStyle, Id, this);
			cell.Element = this;
			return cell;
		}
コード例 #11
0
		protected UITableViewCell NewCell(string cellId, NSIndexPath indexPath)
		{
			var element = GetElement(indexPath);
	
			if (element == null)
				element = Root;

			var cellStyle = UITableViewCellStyle.Subtitle;
			var cell = new UITableViewElementCell(cellStyle, cellId, element) { IndexPath = indexPath };
			
			return cell;
		}
コード例 #12
0
ファイル: Theme.cs プロジェクト: vknair74/MonoMobile.Views
		private void InitializePropertiesFromCell(UITableViewElementCell cell)
		{
			if (cell != null)
			{
				_Cell = cell;
 
				if (Cell.Accessory != UITableViewCellAccessory.None && Accessory == UITableViewCellAccessory.None)
					Accessory = Cell.Accessory;

				if (Cell.ImageView != null && CellImageIcon == null)
					CellImageIcon = Cell.ImageView.Image;
				
				if (cell.TextLabel != null)
				{
					if (cell.TextLabel.Font.PointSize > 0)
						TextFont = cell.TextLabel.Font;
	
					TextAlignment = cell.TextLabel.TextAlignment;
	
					TextColor = cell.TextLabel.TextColor;

					TextShadowOffset = cell.TextLabel.ShadowOffset;
	
					if (cell.TextLabel.ShadowColor != null)
						TextShadowColor = cell.TextLabel.ShadowColor;
				}
				
				if (cell.DetailTextLabel != null)
				{
					if (cell.DetailTextLabel.Font.PointSize > 0)
						DetailTextFont = cell.DetailTextLabel.Font;
					
					DetailTextAlignment = cell.DetailTextLabel.TextAlignment;
	
					DetailTextColor = cell.DetailTextLabel.TextColor;

					DetailTextShadowOffset = cell.DetailTextLabel.ShadowOffset;
					
					if (cell.DetailTextLabel.ShadowColor != null)
						DetailTextShadowColor = cell.DetailTextLabel.ShadowColor;
				}
				
				Cell.SetNeedsDisplay();
			}
		}
コード例 #13
0
ファイル: Element.cs プロジェクト: vknair74/MonoMobile.Views
		protected void SetVisible(UITableViewElementCell cell)
		{
			if (cell != null)
			{
				cell.Hidden  = !_Visible;
				cell.TableView.SetNeedsDisplay();
			}
		}