public ProductListCell() { SelectionStyle = UITableViewCellSelectionStyle.None; ContentView.BackgroundColor = UIColor.LightGray; imageView = new TopAlignedImageView { ClipsToBounds = true, }; nameLabel = new UILabel { TextColor = UIColor.White, TextAlignment = UITextAlignment.Left, Font = UIFont.FromName("HelveticaNeue-Light", 22), //ShadowColor = UIColor.DarkGray, //ShadowOffset = new System.Drawing.SizeF(.5f,.5f), Layer = { ShadowRadius = 3, ShadowColor = UIColor.Black.CGColor, ShadowOffset = new System.Drawing.SizeF(0, 1f), ShadowOpacity = .5f, } }; priceLabel = new UILabel { Alpha = 0.95f, TextColor = UIColor.White, BackgroundColor = Color.Green, TextAlignment = UITextAlignment.Center, Font = UIFont.FromName("HelveticaNeue", 16), ShadowColor = UIColor.LightGray, ShadowOffset = new SizeF(.5f, .5f), }; var layer = priceLabel.Layer; layer.CornerRadius = 3; ContentView.AddSubviews(imageView, nameLabel, priceLabel); }
public ProductListCell () { SelectionStyle = UITableViewCellSelectionStyle.None; ContentView.BackgroundColor = UIColor.LightGray; imageView = new TopAlignedImageView { ClipsToBounds = true, }; nameLabel = new UILabel { TextColor = UIColor.White, TextAlignment = UITextAlignment.Left, Font = UIFont.FromName ("HelveticaNeue-Light", 22), //ShadowColor = UIColor.DarkGray, //ShadowOffset = new System.Drawing.SizeF(.5f,.5f), Layer = { ShadowRadius = 3, ShadowColor = UIColor.Black.CGColor, ShadowOffset = new System.Drawing.SizeF(0,1f), ShadowOpacity = .5f, } }; priceLabel = new UILabel { Alpha = 0.95f, TextColor = UIColor.White, BackgroundColor = Color.Green, TextAlignment = UITextAlignment.Center, Font = UIFont.FromName ("HelveticaNeue", 16), ShadowColor = UIColor.LightGray, ShadowOffset = new SizeF(.5f, .5f), }; var layer = priceLabel.Layer; layer.CornerRadius = 3; ContentView.AddSubviews (imageView, nameLabel, priceLabel); }
public ProductListCell () { SelectionStyle = UITableViewCellSelectionStyle.None; ContentView.BackgroundColor = UIColor.LightGray; imageView = new TopAlignedImageView { ClipsToBounds = true, }; tapGestureRecognizer = new UITapGestureRecognizer(delegate(UITapGestureRecognizer obj) { if(obj.State == UIGestureRecognizerState.Ended && ProductTapped!=null) ProductTapped(this,this.product); }); imageView.AddGestureRecognizer(tapGestureRecognizer); nameLabel = new UILabel { TextColor = UIColor.White, TextAlignment = UITextAlignment.Left, Font = UIFont.FromName ("HelveticaNeue-Light", 22), //ShadowColor = UIColor.DarkGray, //ShadowOffset = new System.Drawing.SizeF(.5f,.5f), Layer = { ShadowRadius = 3, ShadowColor = UIColor.Black.CGColor, ShadowOffset = new System.Drawing.SizeF(0,1f), ShadowOpacity = .5f, }, UserInteractionEnabled=false }; priceLabel = new UILabel { Alpha = 0.95f, TextColor = UIColor.White, BackgroundColor = Color.Green, TextAlignment = UITextAlignment.Center, Font = UIFont.FromName ("HelveticaNeue", 16), ShadowColor = UIColor.LightGray, ShadowOffset = new SizeF(.5f, .5f), UserInteractionEnabled=false }; var layer = priceLabel.Layer; layer.CornerRadius = 3; ContentView.AddSubviews (imageView, nameLabel, priceLabel); }