private void SetupSubViews() { // Backpanel _backPanel = new UIView { BackgroundColor = iOS.Appearance.Colors.White }; _topBorder = new UIView { BackgroundColor = iOS.Appearance.Colors.RulerColor }; _bottomBorder = new UIView { BackgroundColor = iOS.Appearance.Colors.RulerColor }; // Header var image = UIImage.FromBundle("Icons/default_avatar.jpg"); _avatarImage = new AvatarImage(image); _displayName = new UILabel { Font = iOS.Appearance.Fonts.LatoBoldWithSize(14.5f), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Display Name" }; _timeAgo = new UILabel { Font = iOS.Appearance.Fonts.LatoWithSize(11.86f), TextColor = iOS.Appearance.Colors.SubTextColor, Text = "30 minutes ago" }; // Content _contentContainer = new UIView { BackgroundColor = UIColor.Clear, }; // Footer _ruler = new UIView { BackgroundColor = iOS.Appearance.Colors.RulerColor }; _commentButton = new FeedButton { ImageTopSpacing = 3 }; _likeButton = new FeedButton { ImageBottomSpacing = 3 }; // Add views ContentView.Add(_backPanel); ContentView.Add(_topBorder); ContentView.Add(_bottomBorder); ContentView.Add(_avatarImage); ContentView.Add(_displayName); ContentView.Add(_timeAgo); ContentView.Add(_contentContainer); ContentView.Add(_ruler); ContentView.Add(_commentButton); ContentView.Add(_likeButton); //_imageViewLoader = new MvxImageViewLoader(() => _avatarImage) { DefaultImagePath = "res:Icons/default_avatar.jpg" }; foreach (var uiView in ControllsToAdd()) { _contentContainer.Add(uiView); } }
private void SetupSubViews() { BackgroundColor = iOS.Appearance.Colors.BackgroundColor; SelectionStyle = UITableViewCellSelectionStyle.None; // Backpanel _backPanel = new UIView { BackgroundColor = iOS.Appearance.Colors.White, AccessibilityIdentifier = "BackPanel" }; _topBorder = new UIView { BackgroundColor = iOS.Appearance.Colors.BackPanelBorderTop, AccessibilityIdentifier = "TopBorder" }; _bottomBorder = new UIView { BackgroundColor = iOS.Appearance.Colors.BackPanelBorderBottom, AccessibilityIdentifier = "BottomBorder" }; // Header _avatarImageView = new AvatarImageView { AccessibilityIdentifier = "AvatarImage" }; _displayName = new UILabel { Font = iOS.Appearance.Fonts.LatoBoldWithSize(14.5f), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Display Name", AccessibilityIdentifier = "DisplayName" }; _timeAgo = new UILabel { Font = iOS.Appearance.Fonts.LatoWithSize(11.86f), TextColor = iOS.Appearance.Colors.SubTextColor, Text = "30 minutes ago", AccessibilityIdentifier = "TimeAgo" }; _contextButton = new UIButton(); _contextButton.TouchUpInside += ContextButtonOnTouchUpInside; var contextButtonImage = UIImage.FromBundle("Icons/icon_more.png"); _contextButton.SetImage(contextButtonImage, UIControlState.Normal); // Text _postText = new HtmlTextView(ShouldInteractWithUrl) { AccessibilityIdentifier = "PostText" }; // Content _mainImage = new UIImageView { ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor }; // Text for events and other items _date = new UILabel { TextColor = iOS.Appearance.Colors.DefaultTextColor, Font = iOS.Appearance.Fonts.LatoWithSize(13), TextAlignment = UITextAlignment.Center }; _dateBackPanel = new UIView { BackgroundColor = iOS.Appearance.Colors.White }; _dateBackPanel.Layer.CornerRadius = 4.0f; _infoContainer = new UIView(); _infoContainerPlaceholder = new UIView(); _title = new UILabel { TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoBlackWithSize(24), Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation }; _time = new UILabel { TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoWithSize(15) }; _location = new UILabel { TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoWithSize(15), Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation }; _leftSubImage = new UIImageView { ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor }; _rightSubImage = new UIImageView { ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor }; // Footer _ruler = new UIView { BackgroundColor = iOS.Appearance.Colors.RulerColor }; _commentButton = new FeedButton { ImageTopSpacing = 3 }; _likeButton = new FeedButton { ImageBottomSpacing = 3 }; // Add views ContentView.AddSubviews(_backPanel, _topBorder, _bottomBorder, _avatarImageView, _displayName, _timeAgo, _postText, _mainImage, _infoContainer, _infoContainerPlaceholder, _title, _dateBackPanel, _date, _time, _location, _leftSubImage, _rightSubImage, _ruler, _commentButton, _likeButton, _contextButton); }