Created
February 17, 2019 18:08
-
-
Save lubiepomaranczki/bea698576cd43087fcd6ced4b7eb58f0 to your computer and use it in GitHub Desktop.
BookHeader for SectionedCollectionView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BookHeader : UICollectionReusableView | |
{ | |
public static readonly NSString Key = new NSString("BookHeader"); | |
private UILabel headerText; | |
public string HeaderText | |
{ | |
get { return headerText.Text; } | |
set | |
{ | |
headerText.Text = value; | |
SetNeedsDisplay(); | |
} | |
} | |
[Export("initWithFrame:")] | |
public BookHeader(System.Drawing.RectangleF frame) | |
: base(frame) | |
{ | |
BackgroundColor = UIColor.FromRGBA(170, 170, 170, 170); | |
headerText = new UILabel | |
{ | |
TranslatesAutoresizingMaskIntoConstraints = false, | |
TextColor = UIColor.FromRGB(245, 241, 230), | |
TextAlignment = UITextAlignment.Center | |
}; | |
AddSubview(headerText); | |
headerText.LeftAnchor.ConstraintEqualTo(LeftAnchor).Active = true; | |
headerText.RightAnchor.ConstraintEqualTo(RightAnchor).Active = true; | |
headerText.CenterYAnchor.ConstraintEqualTo(CenterYAnchor).Active = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment